geText2D

From GriffinEngine
Jump to: navigation, search

A simple 2D sprite implementation. It can be positioned, rotated, and scaled.

Usage

Inheritance

Base classes


Reference

Fields

Note: All coordinates are in pixels, relative to top-left corner of the window. All angles are in degrees.

  •  double x;      // x coordinate (px)
  •  double y;      // y coordinate (px)
  •  double r;      // rotation (degrees) - around axis point
  •  double s;      // scale - around axis point
  •  double w;      // width (px)
  •  double h;      // height (px)
  •  double alignX; // horizontal alignment offset - use Align() to set these
  •  double alignY; // vertical alignment offset
  •  double axisX;  // horizontal axis offset - use SetAxis() to set these
  •  double axisY;  // vertical axis offset
  •  bool active;   // indicates whether object should be active/visible
  •  color color1; // color of the top half of the gradient
  •  color color2; // color of the bottom half of the gradient (can be same as color1 for solid color)
  •  geFont* font; // font

Constructors

  •  geText2D( const string& _font, double _x=0, double _y=0, string _text="" );
  •  geText2D( const geText2D& original ); // copy constructor

Methods

  •  virtual void Align( int alignment = GE_ALIGN_TL, double _alignX = 0, double _alignY = 0 );
  •  virtual void SetAxis( int axis = GE_ALIGN_CENTER, double _axisX = 0, double _axisY = 0 );
  •  void setText( const string& _text );
  •  void setText( char* _text );