#include <imnode.h>
Inheritance diagram for KrImNode::
Public Methods | |
int | ZDepth () |
Every node has a Z-Depth within the node that contains it. More... | |
void | SetZDepth (int z) |
Set the z-depth of this node relative to its siblings. | |
int | X (int window=0) |
Return the x postion of this node, relative to its parent. | |
int | Y (int window=0) |
Return the y position of this node, relative to its parent. | |
GlFixed | XScale (int window=0) |
Return the x scale of this node, untransformed by parent. | |
GlFixed | YScale (int window=0) |
Return the x scale of this node, untransformed by parent. | |
const KrMatrix2 & | Transform (int window=0) |
Query the entire transformation matrix. | |
void | SetPos (int x, int y, int window=KR_ALL_WINDOWS) |
Set the x and y positon of the ImNode, relative to the node's parent. More... | |
void | SetScale (GlFixed xScale, GlFixed yScale, int window=KR_ALL_WINDOWS) |
Set the scale of this ImNode, which changes all the children as well. | |
void | SetTransform (KrMatrix2 &xForm, int window=KR_ALL_WINDOWS) |
Set the transformation matrix of this ImNode: combines the SetPos and SetScale functionality. | |
void | SetQuality (int quality, int window=KR_ALL_WINDOWS) |
Set the drawing quality for scaling. More... | |
void | DeltaPos (int deltaX, int deltaY, int window=KR_ALL_WINDOWS) |
Offsets the node position. | |
const KrColorTransform & | CTransform (int window=0) |
Get the color transformation of the node. | |
virtual void | SetColor (const KrColorTransform &color, int window=KR_ALL_WINDOWS) |
Set the color of a node. More... | |
virtual KrImage * | ToImage () |
Return a pointer if this is an image. | |
virtual KrSprite * | ToSprite () |
Return a pointer if this is a sprite. | |
virtual KrTile * | ToTile () |
Return a pointer if this is a tile. | |
virtual KrCanvas * | ToCanvas () |
Return a pointer if this is a canvas. | |
virtual KrTextBox * | ToTextBox () |
Return a pointer if this is a text box. | |
virtual KrBox * | ToBox () |
Return a pointer if this is a box. | |
virtual KrWidget * | ToWidget () |
Return a pointer if this is a widget. | |
virtual KrImNode * | ToExtended (const std::string &type) |
A generic cast. More... | |
const std::string & | NodeName () |
Any ImNode can have a name or id. More... | |
int | NodeId () |
Any ImNode can have a name or id. More... | |
void | SetNodeName (const std::string &name) |
Set the name of this node. More... | |
void | SetNodeId (int id) |
Set the id of this node. More... | |
GlInsideNodeIt< KrImNode *> | ChildTreeIterator () |
Fetch an iterator to walk the children with. | |
virtual bool | HitTest (int x, int y, int flags, GlDynArray< KrImage *> *results, int window) |
Hit test this object. Returns true if there was a hit, and 'this' will be added to results. | |
bool | IsVisible (int window=0) |
Return the visibility of this node, taking into account the state of all its parents. | |
bool | IsThisVisible (int window=0) |
Return the visibility of this node, NOT taking into account the state of all its parents. | |
virtual void | SetVisible (bool visible, int window=KR_ALL_WINDOWS) |
If visible is set to false, this node and all its children will not show up on the stage. More... | |
void | ScreenToObject (int x, int y, KrVector2T< GlFixed > *object, int window=0) |
Transform screen (pixel) coordinates to local object coordinates. More... | |
void | SetUserData (void *data) |
A hook to set user defined data. | |
void | SetUserDataU32 (U32 data) |
A hook to set user defined data. Sets the *same* user data as SetUserData, just uses a convenience cast. | |
void * | GetUserData () |
Fetches the user defined data. | |
U32 | GetUserDataU32 () |
Fetches the user defined data. Fetches the *same* user data as GetUserData, just uses a convenience cast. | |
virtual KrImNode * | Clone () |
Return a copy if this object, not in a Tree(). More... | |
KrImNode * | Parent () |
The parent of this KrImNode. | |
KrEngine * | Engine () |
The engine this KrImNode is in. | |
Protected Methods | |
void | Resort (KrImNode *resortMe) |
Resort can be called if a node's depth has changed and it needs to move elsewhere in the list. | |
Friends | |
class | KrImageTree |
The class in not abstract -- it can be very useful to have a KrImNode that is used as a container for other objects.
Children always draw on top of their parents.
|
Return a copy if this object, not in a Tree(). It is return untransformed. In the case of a sprite, the action and frame will be set to the current value. Reimplemented in KrBox, KrCanvas, KrSprite, KrTextBox, and KrTile. |
|
Any ImNode can have a name or id. They are completely managed by the user -- they are not used by the engine in any way. They should be unique to the tree, and can be used as a way to keep track of nodes. An empty name or an id<0 indicate no name and no id, respectively. |
|
Any ImNode can have a name or id. They are completely managed by the user -- they are not used by the engine in any way. They should be unique to the tree, and can be used as a way to keep track of nodes. An empty name or an id<0 indicate no name and no id, respectively. |
|
Transform screen (pixel) coordinates to local object coordinates. The composite Xform is used for this and must be initialized -- practically, the object must be in a Tree to call this method. |
|
Set the color of a node. This color transforms all the node's children as well. |
|
Set the id of this node. It must be > 0. This is completely user defined. Like the name, this should be unique. In DEBUG mode, an assertion will fire if an id is re-used. |
|
Set the name of this node. This is completely user defined. The name of a node should be unique. In DEBUG mode, an assertion will fire if the same name is used twice. |
|
Set the x and y positon of the ImNode, relative to the node's parent. Even non-drawing nodes have position since changing the position moves the node's children. Setting the positon of the root node scrolls the screen. |
|
Set the drawing quality for scaling. Quality is inherited from the parent the same way other properties are, if the quality is set to KrQualityNone, else the set quality is used. Cached scaling is always at maximum quality. |
|
If visible is set to false, this node and all its children will not show up on the stage. Returns true if the visiblity was changed by this call. |
|
A generic cast. The Kyra library is not as extensible as it could be; this implements a "cheap RTTI" if you add your own sub-classes. Arbitrary casting to any type in the string. For example, MyClassType* myType = (MyClassType*) node->ToExtended( "MyClassType" ); Reimplemented in KrConsole. |
|
Every node has a Z-Depth within the node that contains it. The lowest z-depth is the farthest from the viewer. Any integer value is acceptable. Nodes at the same z-depth are sorted by the order they were added to the tree. The last one added is the closest to the viewer. (It is not a good idea to mix z-depth changing and "order sorting." Go with one or the other. Changing the z-depth of the root is meaningless. (It has no siblings.) |