Things related to drawing graphics on screen. More...
Classes | |
class | Color |
color in RGB space, with optional alpha More... | |
class | Font |
font for text drawing and measuring (GUI Only) More... | |
class | GraphicsManager |
Used to create and track ports (GUI Only) More... | |
class | Image |
A bitmap image that can be blitted onto the screen. More... | |
class | ImageStrip |
bitmap image containing a number of frames that can be blitted onto the screen More... | |
class | ISpriteDrawHelper |
helper for drawing sprite overlays and add-on effects More... | |
class | Offset |
offset within a 2D coordinate system More... | |
class | Point |
point for 2D coordinate system More... | |
class | Port |
area in which drawing is done, a viewport (GUI Only) More... | |
struct | PortDrawEvent |
a port needs to be redrawn (GUI Only) More... | |
struct | PortResizedEvent |
a port has been resized (GUI Only) More... | |
class | Quad |
4 point polygon in 2D system More... | |
class | Rect |
Rectangle for 2D coordinate system. More... | |
class | ResourceManager |
used for loading resources More... | |
class | RotatedRect |
rectangle with rotation for 2D coordinate system. More... | |
class | Vector |
vector (magnitude and direction) within a 2D coordinate system. More... | |
Variables | |
const | action_DrawPortComplete = 43 |
eventType_SpriteLayer action: all drawing for every SpriteLayer has completed More... | |
const | action_ErasePort = 40 |
eventType_SpriteLayer action: about to start drawing each SpriteLayer More... | |
const | action_PostDrawLayer = 42 |
eventType_SpriteLayer action: completed rendering for a particular SpriteLayer More... | |
const | action_PreDrawLayer = 41 |
eventType_SpriteLayer action: about to render a particular SpriteLayer More... | |
Things related to drawing graphics on screen.
class pdg::ISpriteDrawHelper |
helper for drawing sprite overlays and add-on effects
Implement this interface to do extra drawing stuff for a specific Sprite then start using it by calling the sprite's setDrawHelper() method. You can only have one Sprite Draw Helper attached to a particular sprite for normal drawing (before the sprite would normally draw) and one for post draw (after the sprite has been drawn)
For those coding in Javascript, there is an implementation of ISpriteDrawHelper that maps a function definition to the draw call. So to create a helper:
If you need something more complex, you can also use classify to create a new Javascript class that derives from pdg.ISpriteDrawHelper, and it will call the draw() method of your class. For example:
As you can see from the examples above, your Sprite Draw Helper function (or draw() method) will be called with two parameters, and return a boolean:
struct pdg::PortDrawEvent |
a port needs to be redrawn (GUI Only)
Generated by the GraphicsManager whenever it is time to redraw a Port. All drawing calls should be done during the handling of a eventType_PortDraw.
{ emitter: {}, // the emitter that generated this event eventType: 24, // the event type (eventType_PortDraw) port: {}, // the port that needs to be redrawn frameNum: 12897 // how many times this event has been generated for this port }
struct pdg::PortResizedEvent |
a port has been resized (GUI Only)
Generated by the GraphicsManager whenever a Port is resized or when the device orientation is changed.
{ emitter: {}, // the emitter that generated this event eventType: 15, // the event type (eventType_PortResized) port: {}, // the port that was resized screenPos: 0 // one of the screenPos_ constants, in this case screenPos_Normal }
action_DrawPortComplete = 43 |
eventType_SpriteLayer action: all drawing for every SpriteLayer has completed
Emitted once per frame, after all drawing for all layers is done.
action_ErasePort = 40 |
eventType_SpriteLayer action: about to start drawing each SpriteLayer
Emitted once per frame, before the drawing of sprite layers is started.
action_PostDrawLayer = 42 |
eventType_SpriteLayer action: completed rendering for a particular SpriteLayer
Emitted once per layer per frame, after all drawing for that layer is complete.
action_PreDrawLayer = 41 |
eventType_SpriteLayer action: about to render a particular SpriteLayer
Emitted once per layer per frame, before any drawing for that layer is performed.