|
Arcade
|
Peripheral providing an interface with the BudgetBoy graphics hardware. More...
Public Member Functions | |
| Vector2I | WorldToScreen (Vector2F pos) |
| Transforms a world position to a position on screen. More... | |
| Vector2F | ScreenToWorld (Vector2I pos) |
| Transforms a position on screen to a world position. More... | |
| void | SetClearColor (SwatchIndex index) |
| Sets the color the screen will be cleared to using the specified palette index. More... | |
| Image | GetImage (String location) |
| Finds an image at the specified location. See RawImage for a description of supported formats. More... | |
| Animation | CreateAnimation< T > (Func< T, String > selector, params T[] frameIndices) |
| Creates an animation from an array of frame indentifiers of type T and a selector function that converts each index into a frame location string. More... | |
| Animation | CreateAnimation< T > (Func< T, String > selector, IEnumerable< T > frameIndices) |
| Creates an animation from a collection of frame indentifiers of type T and a selector function that converts each index into a frame location string. More... | |
| Animation | CreateAnimation (IEnumerable< String > frameLocations) |
| Creates an animation from a collection of frame image location strings. More... | |
| Animation | CreateAnimation (params String[] frameLocations) |
| Creates an animation from an array of frame image location strings. More... | |
| void | SetScissor (RectI bounds) |
| Sets the clipping rectangle. While set, only content in this rect is drawn. More... | |
| void | ClearScissor () |
| Clears the scissor rect, if set. More... | |
| void | PopTransform () |
| Pops the current transformation, making the previous transformation active. More... | |
| void | ClearTransform () |
| Pops all transformations, making the identity transform active. More... | |
| IDisposable | PushTranslation (Vector2F translation) |
| Pushes a translation transformation. More... | |
| IDisposable | PushRotation (float radians) |
| Pushes a global rotation transformation. More... | |
| IDisposable | PushScale (float scale) |
| Pushes a global scaling transformation. Value must be positive and less than 256. More... | |
| IDisposable | PushScale (Vector2F scale) |
| Pushes a global scaling transformation. Both components must be positive values less than 256. More... | |
| void | DrawPoint (SwatchIndex swatchIndex, float size, Vector2F point) |
| Draws a single point. More... | |
| void | DrawPoints (SwatchIndex swatchIndex, float size, params Vector2F[] points) |
| Draws multiple points. More... | |
| void | DrawLine (SwatchIndex swatchIndex, float thickness, Vector2F start, Vector2F end) |
| Draws a single line. More... | |
| void | DrawLines (SwatchIndex swatchIndex, float thickness, params Vector2F[] points) |
| Draws multiple lines, with each point connecting to the next. More... | |
| void | DrawLines (SwatchIndex swatchIndex, float thickness, IList< Vector2F > points) |
| Draws multiple lines, with each point connecting to the next. More... | |
| void | DrawRect (SwatchIndex swatchIndex, int thickness, Vector2F origin, Vector2F size) |
| Draws the outline of a rectangle. More... | |
| void | DrawRect (SwatchIndex swatchIndex, int thickness, RectF rect) |
| Draws the outline of a rectangle. More... | |
| void | FillRect (SwatchIndex swatchIndex, Vector2F origin, Vector2F size) |
| Draws a filled rectangle. More... | |
| void | FillRect (SwatchIndex swatchIndex, RectF rect) |
| Draws a filled rectangle. More... | |
| void | Render (Sprite sprite) |
| Draw a given Sprite to the screen. More... | |
| void | Render (IRenderable renderable) |
| Draw a given IRenderable to the screen. More... | |
| void | Render (IEnumerable< IRenderable > renderables) |
| Draws a enumerator of IRenderables to the screen. More... | |
Public Member Functions inherited from GameAPI.Peripheral< TGame, TProvider, TImplementation > | |
| override void | Dispose () |
Public Attributes | |
| const int | MinimumDisplayWidth = 1 |
| Smallest allowed horizontal display resolution. More... | |
| const int | MaximumDisplayWidth = 256 |
| Largest allowed horizontal display resolution. More... | |
| const int | MinimumDisplayHeight = 1 |
| Smallest allowed vertical display resolution. More... | |
| const int | MaximumDisplayHeight = 240 |
| Largest allowed vertical display resolution. More... | |
| const int | RenderPayloadLimit = 512 |
| Maximum number of bytes that may be streamed per frame. Currently unenforced. More... | |
Protected Member Functions | |
| override void | OnInitialize () |
| override void | OnRegisterResourceTypes (ResourceManager library) |
| override void | OnLoadResources (Resources volume) |
| override void | OnSerializeSetup (Stream stream) |
| override void | OnCopyFrame (Stream frame) |
| override void | OnSerializeFrame (Stream stream) |
Protected Member Functions inherited from GameAPI.GraphicsBase< TGame, TImplementation > | |
| override void | OnAttachImplementation () |
Protected Member Functions inherited from GameAPI.Peripheral | |
| void | ClearFrameWriter () |
| virtual void | OnReset () |
| virtual void | OnDeserializeSetup (Stream stream) |
| virtual void | OnStartControlling () |
| virtual void | OnStopControlling () |
| virtual void | OnDeserializeFrame (Stream stream) |
| virtual void | OnUpdateFrame (double dt) |
Properties | |
| Palette | Palette [get] |
| A palette of color swatches used when drawing elements. More... | |
| SwatchIndex | ClearColorIndex [get] |
| The background color. More... | |
| Vector2F | Center [get] |
| Position of the middle of the screen in pixels. More... | |
| RectI | Scissor [get] |
| Current clipping rectangle. Only accessible duing OnRender() calls. More... | |
| RectF | WorldScissorBounds [get] |
| Gets the smallest bounding rectangle in world space that encloses the clipping rectangle. More... | |
| Transform | Transform [get] |
| Current global transformation resulting from calls to PushTranslation(), PushRotation() and PushScale(). This is reset to the identity transformation each frame. Only accessible duing OnRender() calls. More... | |
| Transform | NoTranslationTransform [get] |
| Current transform without a translation. Only accessible duing OnRender() calls. More... | |
| Transform | InverseTransform [get] |
| Inverse of the current global transformation. Only accessible duing OnRender() calls. More... | |
Properties inherited from GameAPI.GraphicsBase< TGame, TImplementation > | |
| int | Width [get] |
| Horizontal resolution of the screen in pixels. More... | |
| int | Height [get] |
| Vertical resolution of the screen in pixels. More... | |
| int | LastFrameSize [get] |
| Number of bytes of graphical data drawn last frame. More... | |
| Vector2I | Size [get] |
| Resolution of the screen in pixels. More... | |
| float | Aspect [get] |
| Aspect ratio of the screen. More... | |
| bool | ShouldSerialize [get] |
Properties inherited from GameAPI.Peripheral< TGame, TProvider, TImplementation > | |
| virtual bool | ShouldUpdate [get] |
Properties inherited from GameAPI.Peripheral | |
| BinaryWriter | FrameWriter [get] |
Peripheral providing an interface with the BudgetBoy graphics hardware.
|
inline |
Clears the scissor rect, if set.
|
inline |
Pops all transformations, making the identity transform active.
|
inline |
Creates an animation from a collection of frame image location strings.
| frameLocations | Collection of frame image resource locations. |
var anim = Graphics.CreateAnimation(Enumerable.Range(0, 8).Select(i => "images/player/jump_" + i));
|
inline |
Creates an animation from an array of frame image location strings.
| frameLocations | Array of frame image resource locations. |
var anim = Graphics.CreateAnimation("images/player/hurt_0", "images/player/hurt_1", "images/player/hurt_2");
|
inline |
Creates an animation from an array of frame indentifiers of type T and a selector function that converts each index into a frame location string.
| T | Frame identifier type. |
| selector | Function to convert a frame identifier into a resource location string. |
| frameIndices | Collection of frame identifiers. |
var anim = Graphics.CreateAnimation(i => "images/player/walk_" + i, 0, 1, 2, 3, 2, 1);
|
inline |
Creates an animation from a collection of frame indentifiers of type T and a selector function that converts each index into a frame location string.
| T | Frame identifier type. |
| selector | Function to convert a frame identifier into a resource location string. |
| frameIndices | Collection of frame identifiers. |
var anim = Graphics.CreateAnimation(i => "images/player/jump_" + i, Enumerable.Range(0, 8));
|
inline |
Draws a single line.
| swatchIndex | The SwatchIndex used to color the line (only the first color is used). |
| thickness | The thickness of the line in pixels. |
| start | The world position of the line's starting point. |
| end | The world position of the line's ending point. |
|
inline |
Draws multiple lines, with each point connecting to the next.
| swatchIndex | The SwatchIndex used to color the lines (only the first color is used). |
| thickness | The thickness of the lines in pixels. |
| points | The world position of the lines' points. |
|
inline |
Draws multiple lines, with each point connecting to the next.
| swatchIndex | The SwatchIndex used to color the lines (only the first color is used). |
| thickness | The thickness of the lines in pixels. |
| points | The world position of the lines' points. |
|
inline |
Draws a single point.
| swatchIndex | The SwatchIndex used to color the point (only the first component color in the swatch is used). |
| size | The size of the point. |
| point | The world position of the center of the point. |
|
inline |
Draws multiple points.
| swatchIndex | The SwatchIndex used to color the points (only the first component color in the swatch is used). |
| size | The size of the points. |
| points | The world position of the center of each point. |
|
inline |
Draws the outline of a rectangle.
| swatchIndex | The SwatchIndex used to color the rect (only the first component color in the swatch is used). |
| thickness | The thickness in pixels of the outline. |
| origin | The world position of the lower-left point of the rect. |
| size | The width/height of the rect in pixels. |
|
inline |
Draws the outline of a rectangle.
| swatchIndex | The SwatchIndex used to color the rect (only the first component color in the swatch is used). |
| thickness | The thickness in pixels of the outline. |
| rect | The RectI to outline. |
|
inline |
Draws a filled rectangle.
| swatchIndex | The SwatchIndex used to color the rect (only the first component color in the swatch is used). |
| origin | The world position of the lower-left point of the rect. |
| size | The width/height of the rect in pixels. |
|
inline |
Draws a filled rectangle.
| swatchIndex | The SwatchIndex used to color the rect (only the first component color in the swatch is used). |
| rect | The RectI to fill. |
|
inline |
Finds an image at the specified location. See RawImage for a description of supported formats.
| location | File location relative to your game's root folder, without an extension. |
// Retrieves an image from "images/player.png" var img = GetImage("images/player");
|
inlineprotectedvirtual |
Reimplemented from GameAPI.Peripheral.
|
inlineprotectedvirtual |
Reimplemented from GameAPI.Peripheral< TGame, TProvider, TImplementation >.
|
inlineprotectedvirtual |
Reimplemented from GameAPI.Peripheral.
|
inlineprotectedvirtual |
Reimplemented from GameAPI.Peripheral.
|
inlineprotectedvirtual |
Reimplemented from GameAPI.Peripheral.
|
inlineprotectedvirtual |
Reimplemented from GameAPI.Peripheral.
|
inline |
Pops the current transformation, making the previous transformation active.
|
inline |
Pushes a global rotation transformation.
| radians | Rotation in radians. |
|
inline |
Pushes a global scaling transformation. Value must be positive and less than 256.
| scale | Horizontal and vertical scale. |
|
inline |
Pushes a global scaling transformation. Both components must be positive values less than 256.
| scale | Horizontal and vertical scale. |
|
inline |
Pushes a translation transformation.
| translation | World space translation. |
|
inline |
|
inline |
Draw a given IRenderable to the screen.
| renderable | The IRenderable to draw |
|
inline |
Draws a enumerator of IRenderables to the screen.
| renderables | The collection of IRenderables to draw (example: Stage) |
Transforms a position on screen to a world position.
| pos | Screen position. |
|
inline |
Sets the color the screen will be cleared to using the specified palette index.
| index | Swatch index of the new clear color. |
|
inline |
Sets the clipping rectangle. While set, only content in this rect is drawn.
| bounds | The rect to limit drawing to. |
Transforms a world position to a position on screen.
| pos | World position. |
| const int GameAPI.BudgetBoy.Graphics.MaximumDisplayHeight = 240 |
Largest allowed vertical display resolution.
| const int GameAPI.BudgetBoy.Graphics.MaximumDisplayWidth = 256 |
Largest allowed horizontal display resolution.
| const int GameAPI.BudgetBoy.Graphics.MinimumDisplayHeight = 1 |
Smallest allowed vertical display resolution.
| const int GameAPI.BudgetBoy.Graphics.MinimumDisplayWidth = 1 |
Smallest allowed horizontal display resolution.
| const int GameAPI.BudgetBoy.Graphics.RenderPayloadLimit = 512 |
Maximum number of bytes that may be streamed per frame. Currently unenforced.
|
get |
Position of the middle of the screen in pixels.
|
get |
The background color.
|
get |
Inverse of the current global transformation. Only accessible duing OnRender() calls.
|
get |
Current transform without a translation. Only accessible duing OnRender() calls.
|
get |
A palette of color swatches used when drawing elements.
|
get |
Current clipping rectangle. Only accessible duing OnRender() calls.
|
get |
Current global transformation resulting from calls to PushTranslation(), PushRotation() and PushScale(). This is reset to the identity transformation each frame. Only accessible duing OnRender() calls.
|
get |
Gets the smallest bounding rectangle in world space that encloses the clipping rectangle.