|
| | Sprite (std::string name, Actor actor, bool menuSprite=false) |
| |
| | ~Sprite () |
| |
| void | setAnimation (int animation) |
| | Changes to the specified animation beginning at 0. More...
|
| |
| SpriteFrame * | getAnimation () |
| | Returns active animation. More...
|
| |
| void | setFrame (int frame) |
| | Changes to the specified frame of the animation beginning at 0. More...
|
| |
| int | getFrame () |
| | Returns active frame. More...
|
| |
| void | setSpeed (float speed) |
| | Sets the Sprite's speed. More...
|
| |
| float | getSpeed () |
| | Returns a Sprite's current speed. More...
|
| |
| void | toggleAnim () |
| | Pauses or resumes an animation. More...
|
| |
| void | startAnim () |
| | Causes the animation to play. More...
|
| |
| void | stopAnim () |
| | Causes the animation to stop. More...
|
| |
| void | rewind () |
| | Resets the Sprite's animation to the first frame. More...
|
| |
| void | draw () |
| | Draws Sprite. More...
|
| |
| void | drawCollisions () |
| | Draws CollisionObject data for the Object (from outside) More...
|
| |
| virtual void | update () |
| | Updates that do not change (i.e. More...
|
| |
| virtual void | runBehavior () |
| | Update to state as well as child object states. More...
|
| |
| vector< Sprite * > | collisionWithSprites (string name, int count=-1) |
| | Checks for collision with sprite of a given name. More...
|
| |
| vector< CollisionObject * > & | getCollisionData () |
| | Returns collision data. More...
|
| |
| Point2D | getBasePos () |
| | Obtain base position. More...
|
| |
| Point2D | getCenterPos () |
| | Obtain Center Pos for Collisions. More...
|
| |
| virtual WorldObjectType | getType () |
| | This provides a simple interface to determine types of objects. More...
|
| |
| | WorldObject (std::string name, Point2D pos=Point2D(), int z=0) |
| |
| void | drawCollisions (vector< CollisionObject * > &vec, const Point2D &pos) |
| | Draws CollisionObject data for the Object. More...
|
| |
| void | setPosition (double x, double y) |
| | Sets the WorldObject's x an y coordinate. More...
|
| |
| void | setPosition (Point2D pos) |
| | Sets the WorldObject's x an y coordinate. More...
|
| |
| void | setBasePosition (double x, double y) |
| | Sets the WorldObject's x an y coordinate relative to base pos. More...
|
| |
| void | setBasePosition (Point2D pos) |
| | Sets the WorldObject's x an y coordinate relative to base pos. More...
|
| |
| void | setCenterPosition (double x, double y) |
| | Sets the WorldObject's x an y coordinate relative to base pos. More...
|
| |
| void | setCenterPosition (Point2D pos) |
| | Sets the WorldObject's x an y coordinate relative to base pos. More...
|
| |
| void | move (double dx=0.0, double dy=0.0) |
| | Move by given amount NOTE: This is an instantaneous movement by a given amount and does not correspond to physics which is set to do the updated amount per second. More...
|
| |
| virtual void | move (Point2D direction) |
| | Moves the WorldObject relative to the current pos. More...
|
| |
| virtual void | moveTowards (Point2D direction) |
| | Move towards a given coordinate (path finding) More...
|
| |
| Point2D | getPosition () |
| | Gets the WorldObject's position. More...
|
| |
| void | setTransparency (float f) |
| | Sets the WorldObject's transparency. More...
|
| |
| float | getTransparency () |
| | Gets the WorldObject's transparency. More...
|
| |
| void | setAngle (float a) |
| | Sets the WorldObject's angle in degrees. More...
|
| |
| float | getAngle () |
| | Gets the WorldObject's angle. More...
|
| |
| void | setVelocity (Point2D vel) |
| | Sets the WorldObject's velocity as a vector (will set MaxVelocity if needed) More...
|
| |
| void | setVelocity (double xVel, double yVel) |
| | Sets the WorldObject's velocity from coordinates (will set MaxVelocity if needed) More...
|
| |
| Point2D | getVelocity () |
| | Gets the WorldObject's Velocity. More...
|
| |
| void | setMaxVelocity (Point2D vel) |
| | Sets the WorldObject's MaxVelocity (magnitude) from (x,y) and transforms into a magnitude. More...
|
| |
| void | setMaxVelocity (double vel, Point2D dir) |
| | Sets the WorldObject's MaxVelocity (magnitude) value in the direction specified. More...
|
| |
| void | setMaxSpeed (double vel) |
| | Sets the WorldObject's MaxVelocity (magnitude) value in the direction specified. More...
|
| |
| Point2D | getMaxVelocity () |
| | Gets the WorldObject's Max Velocity. More...
|
| |
| double | getMaxSpeed () |
| | Gets the WorldObject's Max Speed. More...
|
| |
| double | getMaxSpeedSquared () |
| | Gets the WorldObject's Max Speed Squared (cheaper operation). More...
|
| |
| void | setAcceleration (Point2D accel) |
| | Sets the WorldObject's Acceleration in (x,y) coords. More...
|
| |
| Point2D | getAcceleration () |
| | Gets the WorldObject's Acceleration. More...
|
| |
| void | setZOrder (int i) |
| |
| int | getZOrder () |
| |
| std::string | getName () |
| | returns the WorldObject's name More...
|
| |
| bool | operator< (WorldObject &rhs) |
| | Sort worldObjects. More...
|
| |
Any independent 2D object to be displayed on screen with an animation.
This class is tasked with the following:
- loading and controlling an Animation
- Handling basic physics (Movement etc)
- Todo:
make this be able to exist w/o loading all content
maybe rename to something else because this should also be the same thing used for 3D but with a model?
Definition at line 20 of file Sprite.h.