Inherits Polycode::Entity.
Inherited by Polycode::ScreenEntityInstance, Polycode::ScreenMesh, Polycode::ScreenParticleEmitter, Polycode::ScreenSound, and Polycode::ScreenSoundListener.
Public Member Functions | |
| virtual Entity * | Clone (bool deepClone, bool ignoreEditorOnly) |
| Clones the entity, return an exact copy. | |
| virtual void | applyClone (Entity *clone, bool deepClone, bool ignoreEditorOnly) |
| This method must be implemented by all subvlasses implementing Clone. | |
| void | addEntity (Entity *newChild) |
| void | setPosition (Number x, Number y) |
| Set 2d position. | |
| void | setPosition (const Vector2 &v) |
| Set 2d position. | |
| void | setScale (Number x, Number y) |
| Set 2d scale. | |
| void | setScale (const Vector2 &v) |
| Set 2d scale. | |
| void | setRotation (Number rotation) |
| Set 2d rotation. | |
| Number | getRotation () const |
| Returns current rotation. | |
| Number | getWidth () const |
| Returns the width of the screen entity. | |
| Number | getHeight () const |
| Returns the height of the screen entity. | |
| void | setWidth (Number w) |
| Sets the width of the screen entity. | |
| void | setHeight (Number h) |
| Sets the height of the screen entity. | |
| void | setBlendingMode (int newBlendingMode) |
| Sets the entity's blending mode. | |
| void | setPositionMode (int newPositionMode) |
| Changes the positioning mode of the screen entity. | |
Public Attributes | |
| bool | blockMouseInput |
| If set to true, will block mouse events for underlaying entities. | |
| bool | snapToPixels |
| If this option is true, the screen entity's positions will be roudnded to whole pixels. | |
2D Entity base.
The ScreenEntity is the base class for all 2D elements in Polycode. They can be added to a screen or to other ScreenEntities and are rendered automatically. If you want to create custom screen objects, subclass this. ScreenEntity subclasses Entity, which use 3d positioning and tranformation, but provides some 2d-only versions of the transformation functions for convenience.
| void ScreenEntity::addEntity | ( | Entity * | newChild | ) | [virtual] |
Reimplemented from Polycode::Entity.
| Entity * ScreenEntity::Clone | ( | bool | deepClone, |
| bool | ignoreEditorOnly | ||
| ) | [virtual] |
Clones the entity, return an exact copy.
This method must be implemented in an Entity subclass for you to be able to clone it.
| deepClone | If true, perform a deep clone, cloning all the children. |
| ignoreEditorOnly | If true, ignore all child entities where editorOnly is set to true (will still clone the entity you call Clone() on even if its editorOnly flag is set to true. |
Reimplemented from Polycode::Entity.
Reimplemented in Polycode::ScreenParticleEmitter, Polycode::ScreenImage, Polycode::ScreenLabel, Polycode::ScreenShape, Polycode::ScreenSound, and Polycode::ScreenSprite.
| Number ScreenEntity::getRotation | ( | ) | const |
Returns current rotation.
| Number ScreenEntity::getWidth | ( | ) | const |
Returns the width of the screen entity.
| void ScreenEntity::setBlendingMode | ( | int | newBlendingMode | ) |
Sets the entity's blending mode.
| newBlendingMode | New blending mode to set. Possible values are Renderer::BLEND_MODE_NORMAL, Renderer::BLEND_MODE_LIGHTEN, Renderer::BLEND_MODE_COLOR, Renderer::BLEND_MODE_PREMULTIPLIED, Renderer::BLEND_MODE_MULTIPLY. See the Renderer class for details on individual blending modes. |
Reimplemented from Polycode::Entity.
| void Polycode::ScreenEntity::setHeight | ( | Number | h | ) | [inline] |
Sets the height of the screen entity.
| h | New height value. |
| void ScreenEntity::setPosition | ( | Number | x, |
| Number | y | ||
| ) |
Set 2d position.
| x | Horizontal position. |
| y | Vertical position. |
| void ScreenEntity::setPosition | ( | const Vector2 & | v | ) |
Set 2d position.
| v | New 2D position vector. |
| void ScreenEntity::setPositionMode | ( | int | newPositionMode | ) |
Changes the positioning mode of the screen entity.
If the positioning mode is ScreenEntity::POSITION_TOPLEFT, the entity is translated by half its width and half its height when it's rendered, making all other transformations relative to its top-left cornder.instead of the center. If the mode is ScreenEntity::POSITION_CENTER, the entity is rendered as is. Set to POSITION_CENTER by default.
| newPositionMode | The new positioning mode. |
| void ScreenEntity::setRotation | ( | Number | rotation | ) |
Set 2d rotation.
| rotation | New rotation value in degrees. |
| void ScreenEntity::setScale | ( | Number | x, |
| Number | y | ||
| ) |
Set 2d scale.
| x | Horizontal scale. |
| y | Vertical scale. |
| void ScreenEntity::setScale | ( | const Vector2 & | v | ) |
Set 2d scale.
| v | New 2D scale vector. |
| void Polycode::ScreenEntity::setWidth | ( | Number | w | ) | [inline] |
Sets the width of the screen entity.
| w | New height value. |
If set to true, will block mouse events for underlaying entities.
(NOTE: processInputEvents must be set to true)
If this option is true, the screen entity's positions will be roudnded to whole pixels.
This only works if the screen is using pixel coordinates.