General drawing functions. More...
Public Member Functions | |
| void | Sprite (integer sprite, integer animation, integer frame, number x, number y, integer flipX, integer flipY, number scaleX, number scaleY, number rotation, boolean useInteger, integer paletteID) |
| Draws a sprite. | |
| void | SpriteBasic (Entity entity, number x, number y) |
| Draws a sprite based on an entity's current values (Sprite, CurrentAnimation, CurrentFrame, X, Y, Direction, ScaleX, ScaleY, Rotation). | |
| void | Animator (integer animator, number x, number y, integer flipX, integer flipY, number scaleX=1.0, number scaleY=1.0, number rotation=0.0) |
| Draws an animator based on its current values (Sprite, CurrentAnimation, CurrentFrame) and other provided values. | |
| void | AnimatorBasic (integer animator, Entity entity, number x, number y) |
| Draws an animator based on its current values (Sprite, CurrentAnimation, CurrentFrame) and an entity's other values (X, Y, Direction, ScaleX, ScaleY, Rotation). | |
| void | SpritePart (integer sprite, integer animation, integer frame, number x, number y, integer partX, integer partY, integer partW, integer partH, integer flipX, integer flipY, number scaleX, number scaleY, number rotation, number useInteger, integer paletteID) |
| Draws part of a sprite. | |
| void | Image (integer image, number x, number y, integer paletteID) |
| Draws an image. | |
| void | ImagePart (integer image, integer partX, integer partY, integer partW, integer partH, number x, number y, integer paletteID) |
| Draws part of an image. | |
| void | ImageSized (integer image, number x, number y, number width, number height, integer paletteID) |
| Draws an image, but sized. | |
| void | ImagePartSized (integer image, integer partX, integer partY, integer partW, integer partH, number x, number y, number width, number height, integer paletteID) |
| Draws part of an image, but sized. | |
| void | Layer (integer layerIndex) |
| Draws a layer. | |
| void | View (integer viewIndex, number x, number y) |
| Draws a view. | |
| void | ViewPart (integer viewIndex, number x, number y, integer partX, integer partY, integer partW, integer partH) |
| Draws part of a view. | |
| void | ViewSized (integer viewIndex, number x, number y, number width, number height) |
| Draws a view, but sized. | |
| void | ViewPartSized (integer viewIndex, number x, number y, integer partX, integer partY, integer partW, integer partH, number width, number height) |
| Draws part of a view, but sized. | |
| void | Video () |
| void | VideoPart () |
| void | VideoSized () |
| void | VideoPartSized () |
| void | Tile (integer ID, number x, number y, integer flipX, integer flipY, number scaleX, number scaleY, number rotation, integer paletteID) |
| Draws a tile. | |
| void | Texture (integer texture, number x, number y) |
| Draws a texture. | |
| void | TextureSized (integer texture, number x, number y, number width, number height) |
| Draws a texture, but sized. | |
| void | TexturePart (integer texture, integer partX, integer partY, integer partW, integer partH, number x, number y) |
| Draws part of a texture. | |
| void | SetTextAlign (integer baseline) |
| Sets the text drawing horizontal alignment. The initial value is left. | |
| void | SetTextBaseline (integer baseline) |
| Sets the text drawing vertical alignment. The initial value is top. | |
| void | SetTextAdvance (number ascent) |
| Sets the character spacing multiplier. The initial value is 1.0. | |
| void | SetTextLineAscent (number ascent) |
| Sets the line height multiplier. The initial value is 1.25. | |
| array | MeasureText (array outArray, Font font, string text, number fontSize) |
| Measures UTF-8 text using a font and stores max width and max height into the array. | |
| array | MeasureTextWrapped (array outArray, Font font, string text, number maxWidth, integer maxLines, number fontSize) |
| Measures wrapped UTF-8 text using a font and stores max width and max height into the array. | |
| void | Text (Font font, string text, number x, number y, number fontSize, integer paletteID) |
| Draws UTF-8 text using a font. | |
| void | TextWrapped (Font font, string text, number x, number y, number maxWidth, integer maxLines, number fontSize, integer paletteID) |
| Draws wrapped UTF-8 text using a font. | |
| void | TextEllipsis (Font font, string text, number x, number y, number maxWidth, integer maxLines, number fontSize, integer paletteID) |
| Draws UTF-8 text using a font, but adds ellipsis if the text doesn't fit in maxWidth. | |
| void | Glyph (Font font, integer codepoint, number x, number y, number fontSize, integer paletteID) |
| Draws a glyph for a given code point. | |
| void | TextArray (integer sprite, integer animation, number x, number y, array string, integer startFrame, integer endFrame, integer align, integer spacing, array charOffsetsX, array charOffsetsY, integer paletteID) |
| Draws a series of sprites based on a converted sprite string. | |
| void | SetBlendColor (integer hex, number alpha) |
| Sets the color to be used for drawing and blending. | |
| void | SetTextureBlend (boolean doBlend) |
| Sets whether to use color and alpha blending on sprites, images, and textures. | |
| void | SetBlendMode (BlendMode blendMode) |
| Sets the blend mode used for drawing. | |
| void | SetBlendFactor (BlendFactor sourceFactor, BlendFactor destinationFactor) |
| Sets the blend factors used for drawing. (Only for hardware-rendering). | |
| void | SetBlendFactorExtended (BlendFactor sourceColorFactor, BlendFactor destinationColorFactor, BlendFactor sourceAlphaFactor, BlendFactor destinationAlphaFactor) |
| Sets all the blend factors used for drawing. (Only for hardware-rendering). | |
| void | SetCompareColor (integer hex) |
| Sets the Comparison Color to draw over for Comparison Drawing. | |
| void | SetTintColor (integer hex, number amount) |
| Sets the color to be used for tinting. | |
| void | SetTintMode (TintMode tintMode) |
| Sets the tint mode used for drawing. | |
| void | UseTinting (boolean useTinting) |
| Sets whether to use color tinting when drawing. | |
| void | SetShader (Shader shader) |
| Sets the current shader. | |
| void | SetFilter (Filter filterType) |
| Sets the current filter type. | |
| void | UseStencil (boolean enabled) |
| Enables or disables stencil operations. | |
| void | SetStencilTestFunction (StencilTest stencilTest) |
| Sets the current stencil test function. | |
| void | SetStencilPassOperation (StencilTest stencilOp) |
| Sets the stencil operation for when the stencil test passes. | |
| void | SetStencilFailOperation (StencilTest stencilOp) |
| Sets the stencil operation for when the stencil test fails. | |
| void | SetStencilValue (integer value) |
| Sets the stencil value. | |
| void | SetStencilMask (integer mask) |
| Sets the mask used for all stencil tests. | |
| void | ClearStencil () |
| Clears the stencil. | |
| void | SetDotMask (integer mask) |
| Sets the dot mask. | |
| void | SetHorizontalDotMask (integer mask) |
| Sets the horizontal dot mask. | |
| void | SetVerticalDotMask (integer mask) |
| Sets the vertical dot mask. | |
| void | SetHorizontalDotMaskOffset (integer offsetH) |
| Sets the offset of the horizontal dot mask. | |
| void | SetVerticalDotMaskOffset (integer offsetV) |
| Sets the offset of the vertical dot mask. | |
| void | Line (number x1, number y1, number x2, number y2) |
| Draws a line. | |
| void | Circle (number x, number y, number radius) |
| Draws a circle. | |
| void | Ellipse (number x, number y, number width, number height) |
| Draws an ellipse. | |
| void | Triangle (number x1, number y1, number x2, number y2, number x3, number y3) |
| Draws a triangle. | |
| void | TriangleBlend (number x1, number y1, number x2, number y2, number x3, number y3, integer color1, integer color2, integer color3) |
| Draws a triangle, blending the colors at the vertices. (Colors are multiplied by the global Draw Blend Color, do Draw.SetBlendColor`(0xFFFFFF, 1.0)` if you want the vertex colors unaffected.). | |
| void | Quad (number x1, number y1, number x2, number y2, number x3, number y3, number x4, number y4) |
| Draws a quad. | |
| void | QuadBlend (number x1, number y1, number x2, number y2, number x3, number y3, number x4, number y4, integer color1, integer color2, integer color3, integer color4) |
| Draws a quad, blending the colors at the vertices. (Colors are multiplied by the global Draw Blend Color, do Draw.SetBlendColor`(0xFFFFFF, 1.0)` if you want the vertex colors unaffected.). | |
| void | TriangleTextured (integer image, number x1, number y1, number x2, number y2, number x3, number y3, integer color1, integer color2, integer color3, number u1, number v1, number u2, number v2, number u3, number v3) |
| Draws a textured triangle. | |
| void | QuadTextured (integer image, number x1, number y1, number x2, number y2, number x3, number y3, number x4, number y4, integer color1, integer color2, integer color3, integer color4, number u1, number v1, number u2, number v2, number u3, number v3, number u4, number v4) |
| Draws a textured quad. | |
| void | Rectangle (number x, number y, number width, number height) |
| Draws a rectangle. | |
| void | CircleStroke (number x, number y, number radius, number thickness) |
| Draws a circle outline. | |
| void | EllipseStroke (number x, number y, number width, number height) |
| Draws an ellipse outline. | |
| void | TriangleStroke (number x1, number y1, number x2, number y2, number x3, number y3) |
| Draws a triangle outline. | |
| void | RectangleStroke (number x, number y, number width, number height) |
| Draws a rectangle outline. | |
| void | UseFillSmoothing (boolean smoothFill) |
| Sets whether to use smoothing when drawing filled shapes. (hardware-renderer only). | |
| void | UseStrokeSmoothing (boolean smoothStroke) |
| Sets whether to use smoothing when drawing un-filled shapes. (hardware-renderer only). | |
| void | SetClip (number x, number y, number width, number height) |
| Sets the region in which drawing will occur. | |
| void | ClearClip () |
| Resets the drawing region. | |
| integer | GetClipX () |
| Gets the X position in which drawing starts to occur. | |
| integer | GetClipY () |
| Gets the Y position in which drawing starts to occur. | |
| integer | GetClipWidth () |
| Gets the width in which drawing occurs. | |
| integer | GetClipHeight () |
| Gets the height in which drawing occurs. | |
| void | Save () |
| Saves the current transform matrix to the stack. | |
| void | Scale (number x, number y, number z=1.0) |
| Scales the view. | |
| void | Rotate (number x, number y, number z) |
| Rotates the view. | |
| void | Rotate (number angle) |
| Rotates the view. | |
| void | Restore () |
| Restores the last saved transform matrix from the stack. | |
| void | Translate (number x, number y, number z=0.0) |
| Translates the view. | |
| void | SetTextureTarget (integer texture) |
| Sets the current render target. | |
| void | Clear () |
| Clears the screen. | |
| void | ResetTextureTarget () |
| Resets the current render target. | |
| void | UseSpriteDeform (boolean useDeform) |
| Sets whether to use sprite deform when drawing. | |
| void | SetSpriteDeformLine (integer deformIndex, decimal deformValue) |
| Sets the sprite deform line at the specified line index. | |
| void | UseDepthTesting (boolean useDepthTesting) |
| Sets whether to do depth tests when drawing. | |
| integer | GetCurrentDrawGroup () |
| Gets the draw group currently being drawn. | |
| void | CopyScreen (integer texture) |
| Copies the contents of the screen into a texture. | |
General drawing functions.
Draw provides functions to draw images, sprites, and textures; as well as primitives, such as lines, rectangles, ellipses and polygons. You may also apply basic transformations like translation, scaling, and rotation.
| void Draw.Animator | ( | integer | animator, |
| number | x, | ||
| number | y, | ||
| integer | flipX, | ||
| integer | flipY, | ||
| number | scaleX = 1.0, | ||
| number | scaleY = 1.0, | ||
| number | rotation = 0.0 ) |
Draws an animator based on its current values (Sprite, CurrentAnimation, CurrentFrame) and other provided values.
| animator | The animator to draw. |
| x | X position of where to draw the sprite. |
| y | Y position of where to draw the sprite. |
| flipX | Whether to flip the sprite horizontally. |
| flipY | Whether to flip the sprite vertically. |
| scaleX | Scale multiplier of the sprite horizontally. |
| scaleY | Scale multiplier of the sprite vertically. |
| rotation | Rotation of the drawn sprite, from 0-511. |
| void Draw.AnimatorBasic | ( | integer | animator, |
| Entity | entity, | ||
| number | x, | ||
| number | y ) |
Draws an animator based on its current values (Sprite, CurrentAnimation, CurrentFrame) and an entity's other values (X, Y, Direction, ScaleX, ScaleY, Rotation).
| animator | The animator to draw. |
| entity | The entity to pull other values from. |
| x | X position of where to draw the sprite, otherwise uses the entity's X value. |
| y | Y position of where to draw the sprite, otherwise uses the entity's Y value. |
| void Draw.Circle | ( | number | x, |
| number | y, | ||
| number | radius ) |
Draws a circle.
| x | Center X position of where to draw the circle. |
| y | Center Y position of where to draw the circle. |
| radius | Radius of the circle. |
| void Draw.CircleStroke | ( | number | x, |
| number | y, | ||
| number | radius, | ||
| number | thickness ) |
Draws a circle outline.
| x | Center X position of where to draw the circle. |
| y | Center Y position of where to draw the circle. |
| radius | Radius of the circle. |
| thickness | Thickness of the circle. |
| void Draw.CopyScreen | ( | integer | texture | ) |
Copies the contents of the screen into a texture.
| texture | Texture index. |
| void Draw.Ellipse | ( | number | x, |
| number | y, | ||
| number | width, | ||
| number | height ) |
Draws an ellipse.
| x | X position of where to draw the ellipse. |
| y | Y position of where to draw the ellipse. |
| width | Width to draw the ellipse at. |
| height | Height to draw the ellipse at. |
| void Draw.EllipseStroke | ( | number | x, |
| number | y, | ||
| number | width, | ||
| number | height ) |
Draws an ellipse outline.
| x | X position of where to draw the ellipse. |
| y | Y position of where to draw the ellipse. |
| width | Width to draw the ellipse at. |
| height | Height to draw the ellipse at. |
| integer Draw.GetClipHeight | ( | ) |
Gets the height in which drawing occurs.
| integer Draw.GetClipWidth | ( | ) |
Gets the width in which drawing occurs.
| integer Draw.GetClipX | ( | ) |
Gets the X position in which drawing starts to occur.
| integer Draw.GetClipY | ( | ) |
Gets the Y position in which drawing starts to occur.
| integer Draw.GetCurrentDrawGroup | ( | ) |
Gets the draw group currently being drawn.
| void Draw.Glyph | ( | Font | font, |
| integer | codepoint, | ||
| number | x, | ||
| number | y, | ||
| number | fontSize, | ||
| integer | paletteID ) |
Draws a glyph for a given code point.
| font | The Font. |
| codepoint | Code point to draw. |
| x | X position of where to draw the glyph. |
| y | Y position of where to draw the glyph. |
| fontSize | The size of the font. If this argument is not given, this uses the pixels per unit value that the font was configured with. |
| paletteID | Which palette index to use. |
| void Draw.Image | ( | integer | image, |
| number | x, | ||
| number | y, | ||
| integer | paletteID ) |
Draws an image.
| image | Index of the loaded image. |
| x | X position of where to draw the image. |
| y | Y position of where to draw the image. |
| paletteID | Which palette index to use. |
| void Draw.ImagePart | ( | integer | image, |
| integer | partX, | ||
| integer | partY, | ||
| integer | partW, | ||
| integer | partH, | ||
| number | x, | ||
| number | y, | ||
| integer | paletteID ) |
Draws part of an image.
| image | Index of the loaded image. |
| partX | X coordinate of part of image to draw. |
| partY | Y coordinate of part of image to draw. |
| partW | Width of part of image to draw. |
| partH | Height of part of image to draw. |
| x | X position of where to draw the image. |
| y | Y position of where to draw the image. |
| paletteID | Which palette index to use. |
| void Draw.ImagePartSized | ( | integer | image, |
| integer | partX, | ||
| integer | partY, | ||
| integer | partW, | ||
| integer | partH, | ||
| number | x, | ||
| number | y, | ||
| number | width, | ||
| number | height, | ||
| integer | paletteID ) |
Draws part of an image, but sized.
| image | Index of the loaded image. |
| partX | X coordinate of part of image to draw. |
| partY | Y coordinate of part of image to draw. |
| partW | Width of part of image to draw. |
| partH | Height of part of image to draw. |
| x | X position of where to draw the image. |
| y | Y position of where to draw the image. |
| width | Width to draw the image. |
| height | Height to draw the image. |
| paletteID | Which palette index to use. |
| void Draw.ImageSized | ( | integer | image, |
| number | x, | ||
| number | y, | ||
| number | width, | ||
| number | height, | ||
| integer | paletteID ) |
Draws an image, but sized.
| image | Index of the loaded image. |
| x | X position of where to draw the image. |
| y | Y position of where to draw the image. |
| width | Width to draw the image. |
| height | Height to draw the image. |
| paletteID | Which palette index to use. |
| void Draw.Layer | ( | integer | layerIndex | ) |
Draws a layer.
| layerIndex | Index of layer. |
| void Draw.Line | ( | number | x1, |
| number | y1, | ||
| number | x2, | ||
| number | y2 ) |
Draws a line.
| x1 | X position of where to start drawing the line. |
| y1 | Y position of where to start drawing the line. |
| x2 | X position of where to end drawing the line. |
| y2 | Y position of where to end drawing the line. |
| array Draw.MeasureText | ( | array | outArray, |
| Font | font, | ||
| string | text, | ||
| number | fontSize ) |
Measures UTF-8 text using a font and stores max width and max height into the array.
| outArray | Array to output size values to. |
| font | The Font to be used as text. |
| text | Text to measure. |
| fontSize | The size of the font. If this argument is not given, this uses the pixels per unit value that the font was configured with. |
| array Draw.MeasureTextWrapped | ( | array | outArray, |
| Font | font, | ||
| string | text, | ||
| number | maxWidth, | ||
| integer | maxLines, | ||
| number | fontSize ) |
Measures wrapped UTF-8 text using a font and stores max width and max height into the array.
| outArray | Array to output size values to. |
| font | The Font to be used as text. |
| text | Text to measure. |
| maxWidth | Max width that a line can be. |
| maxLines | Max number of lines to measure. Use null to measure all lines. |
| fontSize | The size of the font. If this argument is not given, this uses the pixels per unit value that the font was configured with. |
| void Draw.Quad | ( | number | x1, |
| number | y1, | ||
| number | x2, | ||
| number | y2, | ||
| number | x3, | ||
| number | y3, | ||
| number | x4, | ||
| number | y4 ) |
Draws a quad.
| x1 | X position of the first vertex. |
| y1 | Y position of the first vertex. |
| x2 | X position of the second vertex. |
| y2 | Y position of the second vertex. |
| x3 | X position of the third vertex. |
| y3 | Y position of the third vertex. |
| x4 | X position of the fourth vertex. |
| y4 | Y position of the fourth vertex. |
| void Draw.QuadBlend | ( | number | x1, |
| number | y1, | ||
| number | x2, | ||
| number | y2, | ||
| number | x3, | ||
| number | y3, | ||
| number | x4, | ||
| number | y4, | ||
| integer | color1, | ||
| integer | color2, | ||
| integer | color3, | ||
| integer | color4 ) |
Draws a quad, blending the colors at the vertices. (Colors are multiplied by the global Draw Blend Color, do Draw.SetBlendColor`(0xFFFFFF, 1.0)` if you want the vertex colors unaffected.).
| x1 | X position of the first vertex. |
| y1 | Y position of the first vertex. |
| x2 | X position of the second vertex. |
| y2 | Y position of the second vertex. |
| x3 | X position of the third vertex. |
| y3 | Y position of the third vertex. |
| x4 | X position of the fourth vertex. |
| y4 | Y position of the fourth vertex. |
| color1 | Color of the first vertex. |
| color2 | Color of the second vertex. |
| color3 | Color of the third vertex. |
| color4 | Color of the fourth vertex. |
| void Draw.QuadTextured | ( | integer | image, |
| number | x1, | ||
| number | y1, | ||
| number | x2, | ||
| number | y2, | ||
| number | x3, | ||
| number | y3, | ||
| number | x4, | ||
| number | y4, | ||
| integer | color1, | ||
| integer | color2, | ||
| integer | color3, | ||
| integer | color4, | ||
| number | u1, | ||
| number | v1, | ||
| number | u2, | ||
| number | v2, | ||
| number | u3, | ||
| number | v3, | ||
| number | u4, | ||
| number | v4 ) |
Draws a textured quad.
| image | Image to draw quad with. |
| x1 | X position of the first vertex. |
| y1 | Y position of the first vertex. |
| x2 | X position of the second vertex. |
| y2 | Y position of the second vertex. |
| x3 | X position of the third vertex. |
| y3 | Y position of the third vertex. |
| x4 | X position of the fourth vertex. |
| y4 | Y position of the fourth vertex. |
| color1 | Color of the first vertex. |
| color2 | Color of the second vertex. |
| color3 | Color of the third vertex. |
| color4 | Color of the fourth vertex. |
| u1 | Texture U of the first vertex. |
| v1 | Texture V of the first vertex. |
| u2 | Texture U of the second vertex. |
| v2 | Texture V of the second vertex. |
| u3 | Texture U of the third vertex. |
| v3 | Texture V of the third vertex. |
| u4 | Texture U of the fourth vertex. |
| v4 | Texture V of the fourth vertex. |
| void Draw.Rectangle | ( | number | x, |
| number | y, | ||
| number | width, | ||
| number | height ) |
Draws a rectangle.
| x | X position of where to draw the rectangle. |
| y | Y position of where to draw the rectangle. |
| width | Width to draw the rectangle at. |
| height | Height to draw the rectangle at. |
| void Draw.RectangleStroke | ( | number | x, |
| number | y, | ||
| number | width, | ||
| number | height ) |
Draws a rectangle outline.
| x | X position of where to draw the rectangle. |
| y | Y position of where to draw the rectangle. |
| width | Width to draw the rectangle at. |
| height | Height to draw the rectangle at. |
| void Draw.Rotate | ( | number | angle | ) |
Rotates the view.
| angle | Desired rotation angle. |
| void Draw.Rotate | ( | number | x, |
| number | y, | ||
| number | z ) |
Rotates the view.
| x | Desired X angle. |
| y | Desired Y angle. |
| z | Desired Z angle. |
| void Draw.Scale | ( | number | x, |
| number | y, | ||
| number | z = 1.0 ) |
Scales the view.
| x | Desired X scale. |
| y | Desired Y scale. |
| z | Desired Z scale. |
| void Draw.SetBlendColor | ( | integer | hex, |
| number | alpha ) |
Sets the color to be used for drawing and blending.
| hex | Hexadecimal format of desired color. (ex: Red = 0xFF0000, Green = 0x00FF00, Blue = 0x0000FF) |
| alpha | Opacity to use for drawing, 0.0 to 1.0. |
| void Draw.SetBlendFactor | ( | BlendFactor | sourceFactor, |
| BlendFactor | destinationFactor ) |
Sets the blend factors used for drawing. (Only for hardware-rendering).
| sourceFactor | Source factor for blending. |
| destinationFactor | Destination facto for blending. |
| void Draw.SetBlendFactorExtended | ( | BlendFactor | sourceColorFactor, |
| BlendFactor | destinationColorFactor, | ||
| BlendFactor | sourceAlphaFactor, | ||
| BlendFactor | destinationAlphaFactor ) |
Sets all the blend factors used for drawing. (Only for hardware-rendering).
| sourceColorFactor | Source factor for blending color. |
| destinationColorFactor | Destination factor for blending color. |
| sourceAlphaFactor | Source factor for blending alpha. |
| destinationAlphaFactor | Destination factor for blending alpha. |
| void Draw.SetBlendMode | ( | BlendMode | blendMode | ) |
Sets the blend mode used for drawing.
| blendMode | The desired blend mode. |
| void Draw.SetClip | ( | number | x, |
| number | y, | ||
| number | width, | ||
| number | height ) |
Sets the region in which drawing will occur.
| x | X position of where to start the draw region. |
| y | Y position of where to start the draw region. |
| width | Width of the draw region. |
| height | Height of the draw region. |
| void Draw.SetCompareColor | ( | integer | hex | ) |
Sets the Comparison Color to draw over for Comparison Drawing.
| hex | Hexadecimal format of desired color. (ex: Red = 0xFF0000, Green = 0x00FF00, Blue = 0x0000FF) |
| void Draw.SetDotMask | ( | integer | mask | ) |
Sets the dot mask.
| mask | The mask. |
| void Draw.SetFilter | ( | Filter | filterType | ) |
Sets the current filter type.
| filterType | The filter type. |
| void Draw.SetHorizontalDotMask | ( | integer | mask | ) |
Sets the horizontal dot mask.
| mask | The mask. |
| void Draw.SetHorizontalDotMaskOffset | ( | integer | offsetH | ) |
Sets the offset of the horizontal dot mask.
| offsetH | The offset. |
| void Draw.SetShader | ( | Shader | shader | ) |
Sets the current shader.
| shader | The shader, or null to unset the shader. |
| void Draw.SetSpriteDeformLine | ( | integer | deformIndex, |
| decimal | deformValue ) |
Sets the sprite deform line at the specified line index.
| deformIndex | Index of deform line. (0 = top of screen, 1 = the line below it, 2 = etc.) |
| deformValue | Deform value. |
| void Draw.SetStencilFailOperation | ( | StencilTest | stencilOp | ) |
Sets the stencil operation for when the stencil test fails.
| stencilOp | One of the stencil operations. |
| void Draw.SetStencilMask | ( | integer | mask | ) |
Sets the mask used for all stencil tests.
| mask | The stencil mask. This value is clamped by the stencil buffer's bit depth. |
| void Draw.SetStencilPassOperation | ( | StencilTest | stencilOp | ) |
Sets the stencil operation for when the stencil test passes.
| stencilOp | One of the stencil operation. |
| void Draw.SetStencilTestFunction | ( | StencilTest | stencilTest | ) |
Sets the current stencil test function.
| stencilTest | One of the stencil test functions. |
| void Draw.SetStencilValue | ( | integer | value | ) |
Sets the stencil value.
| value | The stencil value. This value is clamped by the stencil buffer's bit depth. |
| void Draw.SetTextAdvance | ( | number | ascent | ) |
Sets the character spacing multiplier. The initial value is 1.0.
This does not affect text drawn using a Font.
| ascent | Multiplier for character spacing. |
| void Draw.SetTextAlign | ( | integer | baseline | ) |
Sets the text drawing horizontal alignment. The initial value is left.
This does not affect text drawn using a Font.
| baseline | 0 for left, 1 for center, 2 for right. |
| void Draw.SetTextBaseline | ( | integer | baseline | ) |
Sets the text drawing vertical alignment. The initial value is top.
This does not affect text drawn using a Font.
| baseline | 0 for top, 1 for baseline, 2 for bottom. |
| void Draw.SetTextLineAscent | ( | number | ascent | ) |
Sets the line height multiplier. The initial value is 1.25.
This does not affect text drawn using a Font.
| ascent | Multiplier for line height. |
| void Draw.SetTextureBlend | ( | boolean | doBlend | ) |
Sets whether to use color and alpha blending on sprites, images, and textures.
| doBlend | Whether to use blending. |
| void Draw.SetTextureTarget | ( | integer | texture | ) |
Sets the current render target.
| texture | The texture target. |
| void Draw.SetTintColor | ( | integer | hex, |
| number | amount ) |
Sets the color to be used for tinting.
| hex | Hexadecimal format of desired color. (ex: Red = 0xFF0000, Green = 0x00FF00, Blue = 0x0000FF) |
| amount | Tint amount, from 0.0 to 1.0. |
| void Draw.SetTintMode | ( | TintMode | tintMode | ) |
Sets the tint mode used for drawing.
| tintMode | The desired tint mode. |
| void Draw.SetVerticalDotMask | ( | integer | mask | ) |
Sets the vertical dot mask.
| mask | The mask. |
| void Draw.SetVerticalDotMaskOffset | ( | integer | offsetV | ) |
Sets the offset of the vertical dot mask.
| offsetV | The offset. |
| void Draw.Sprite | ( | integer | sprite, |
| integer | animation, | ||
| integer | frame, | ||
| number | x, | ||
| number | y, | ||
| integer | flipX, | ||
| integer | flipY, | ||
| number | scaleX, | ||
| number | scaleY, | ||
| number | rotation, | ||
| boolean | useInteger, | ||
| integer | paletteID ) |
Draws a sprite.
| sprite | Index of the loaded sprite. |
| animation | Index of the animation entry. |
| frame | Index of the frame in the animation entry. |
| x | X position of where to draw the sprite. |
| y | Y position of where to draw the sprite. |
| flipX | Whether to flip the sprite horizontally. |
| flipY | Whether to flip the sprite vertically. |
| scaleX | Scale multiplier of the sprite horizontally. |
| scaleY | Scale multiplier of the sprite vertically. |
| rotation | Rotation of the drawn sprite in radians, or in integer if useInteger is true. |
| useInteger | Whether the rotation argument is already in radians. |
| paletteID | Which palette index to use. |
| void Draw.SpriteBasic | ( | Entity | entity, |
| number | x, | ||
| number | y ) |
Draws a sprite based on an entity's current values (Sprite, CurrentAnimation, CurrentFrame, X, Y, Direction, ScaleX, ScaleY, Rotation).
| entity | The entity to draw. |
| x | X position of where to draw the sprite, otherwise uses the entity's X value. |
| y | Y position of where to draw the sprite, otherwise uses the entity's Y value. |
| void Draw.SpritePart | ( | integer | sprite, |
| integer | animation, | ||
| integer | frame, | ||
| number | x, | ||
| number | y, | ||
| integer | partX, | ||
| integer | partY, | ||
| integer | partW, | ||
| integer | partH, | ||
| integer | flipX, | ||
| integer | flipY, | ||
| number | scaleX, | ||
| number | scaleY, | ||
| number | rotation, | ||
| number | useInteger, | ||
| integer | paletteID ) |
Draws part of a sprite.
| sprite | Index of the loaded sprite. |
| animation | Index of the animation entry. |
| frame | Index of the frame in the animation entry. |
| x | X position of where to draw the sprite. |
| y | Y position of where to draw the sprite. |
| partX | X coordinate of part of frame to draw. |
| partY | Y coordinate of part of frame to draw. |
| partW | Width of part of frame to draw. |
| partH | Height of part of frame to draw. |
| flipX | Whether to flip the sprite horizontally. |
| flipY | Whether to flip the sprite vertically. |
| scaleX | Scale multiplier of the sprite horizontally. |
| scaleY | Scale multiplier of the sprite vertically. |
| rotation | Rotation of the drawn sprite in radians, or in integer if useInteger is true. |
| useInteger | Whether the rotation argument is already in radians. |
| paletteID | Which palette index to use. |
| void Draw.Text | ( | Font | font, |
| string | text, | ||
| number | x, | ||
| number | y, | ||
| number | fontSize, | ||
| integer | paletteID ) |
Draws UTF-8 text using a font.
| font | The Font to be used as text. |
| text | Text to draw. |
| x | X position of where to draw the text. |
| y | Y position of where to draw the text. |
| fontSize | The size of the font. If this argument is not given, this uses the pixels per unit value that the font was configured with. |
| paletteID | Which palette index to use. |
| void Draw.TextArray | ( | integer | sprite, |
| integer | animation, | ||
| number | x, | ||
| number | y, | ||
| array | string, | ||
| integer | startFrame, | ||
| integer | endFrame, | ||
| integer | align, | ||
| integer | spacing, | ||
| array | charOffsetsX, | ||
| array | charOffsetsY, | ||
| integer | paletteID ) |
Draws a series of sprites based on a converted sprite string.
| sprite | The index of the loaded sprite to be used as text. |
| animation | The animation index. |
| x | The X value to begin drawing. |
| y | The Y value to begin drawing. |
| string | The array containing frame indexes. |
| startFrame | The index to begin drawing. |
| endFrame | The index to end drawing. |
| align | The text alignment. |
| spacing | The space between drawn sprites. |
| charOffsetsX | The X offsets at which to draw per frame. Must also have charOffsetsY to be used. |
| charOffsetsY | The Y offsets at which to draw per frame. |
| paletteID | Which palette index to use. |
| void Draw.TextEllipsis | ( | Font | font, |
| string | text, | ||
| number | x, | ||
| number | y, | ||
| number | maxWidth, | ||
| integer | maxLines, | ||
| number | fontSize, | ||
| integer | paletteID ) |
Draws UTF-8 text using a font, but adds ellipsis if the text doesn't fit in maxWidth.
| font | The Font to be used as text. |
| text | Text to draw. |
| x | X position of where to draw the text. |
| y | Y position of where to draw the text. |
| maxWidth | Max width the text can draw in. |
| maxLines | Max lines of text to draw. Use null to draw all lines. |
| fontSize | The size of the font. If this argument is not given, this uses the pixels per unit value that the font was configured with. |
| paletteID | Which palette index to use. |
| void Draw.Texture | ( | integer | texture, |
| number | x, | ||
| number | y ) |
Draws a texture.
| texture | Texture index. |
| x | X position of where to draw the texture. |
| y | Y position of where to draw the texture. |
| void Draw.TexturePart | ( | integer | texture, |
| integer | partX, | ||
| integer | partY, | ||
| integer | partW, | ||
| integer | partH, | ||
| number | x, | ||
| number | y ) |
Draws part of a texture.
| texture | Texture index. |
| partX | X coordinate of part of texture to draw. |
| partY | Y coordinate of part of texture to draw. |
| partW | Width of part of texture to draw. |
| partH | Height of part of texture to draw. |
| x | X position of where to draw the texture. |
| y | Y position of where to draw the texture. |
| void Draw.TextureSized | ( | integer | texture, |
| number | x, | ||
| number | y, | ||
| number | width, | ||
| number | height ) |
Draws a texture, but sized.
| texture | Texture index. |
| x | X position of where to draw the texture. |
| y | Y position of where to draw the texture. |
| width | Width to draw the texture. |
| height | Height to draw the texture. |
| void Draw.TextWrapped | ( | Font | font, |
| string | text, | ||
| number | x, | ||
| number | y, | ||
| number | maxWidth, | ||
| integer | maxLines, | ||
| number | fontSize, | ||
| integer | paletteID ) |
Draws wrapped UTF-8 text using a font.
| font | The Font to be used as text. |
| text | Text to draw. |
| x | X position of where to draw the text. |
| y | Y position of where to draw the text. |
| maxWidth | Max width the text can draw in. |
| maxLines | Max lines of text to draw. Use null to draw all lines. |
| fontSize | The size of the font. If this argument is not given, this uses the pixels per unit value that the font was configured with. |
| paletteID | Which palette index to use. |
| void Draw.Tile | ( | integer | ID, |
| number | x, | ||
| number | y, | ||
| integer | flipX, | ||
| integer | flipY, | ||
| number | scaleX, | ||
| number | scaleY, | ||
| number | rotation, | ||
| integer | paletteID ) |
Draws a tile.
| ID | ID of the tile to draw. |
| x | X position of where to draw the tile. |
| y | Y position of where to draw the tile. |
| flipX | Whether to flip the tile horizontally. |
| flipY | Whether to flip the tile vertically. |
| scaleX | Horizontal scale multiplier of the tile. |
| scaleY | Vertical scale multiplier of the tile. |
| rotation | Rotation of the drawn tile in radians. |
| paletteID | Which palette index to use. |
| void Draw.Translate | ( | number | x, |
| number | y, | ||
| number | z = 0.0 ) |
Translates the view.
| x | Desired X translation. |
| y | Desired Y translation. |
| z | Desired Z translation. |
| void Draw.Triangle | ( | number | x1, |
| number | y1, | ||
| number | x2, | ||
| number | y2, | ||
| number | x3, | ||
| number | y3 ) |
Draws a triangle.
| x1 | X position of the first vertex. |
| y1 | Y position of the first vertex. |
| x2 | X position of the second vertex. |
| y2 | Y position of the second vertex. |
| x3 | X position of the third vertex. |
| y3 | Y position of the third vertex. |
| void Draw.TriangleBlend | ( | number | x1, |
| number | y1, | ||
| number | x2, | ||
| number | y2, | ||
| number | x3, | ||
| number | y3, | ||
| integer | color1, | ||
| integer | color2, | ||
| integer | color3 ) |
Draws a triangle, blending the colors at the vertices. (Colors are multiplied by the global Draw Blend Color, do Draw.SetBlendColor`(0xFFFFFF, 1.0)` if you want the vertex colors unaffected.).
| x1 | X position of the first vertex. |
| y1 | Y position of the first vertex. |
| x2 | X position of the second vertex. |
| y2 | Y position of the second vertex. |
| x3 | X position of the third vertex. |
| y3 | Y position of the third vertex. |
| color1 | Color of the first vertex. |
| color2 | Color of the second vertex. |
| color3 | Color of the third vertex. |
| void Draw.TriangleStroke | ( | number | x1, |
| number | y1, | ||
| number | x2, | ||
| number | y2, | ||
| number | x3, | ||
| number | y3 ) |
Draws a triangle outline.
| x1 | X position of the first vertex. |
| y1 | Y position of the first vertex. |
| x2 | X position of the second vertex. |
| y2 | Y position of the second vertex. |
| x3 | X position of the third vertex. |
| y3 | Y position of the third vertex. |
| void Draw.TriangleTextured | ( | integer | image, |
| number | x1, | ||
| number | y1, | ||
| number | x2, | ||
| number | y2, | ||
| number | x3, | ||
| number | y3, | ||
| integer | color1, | ||
| integer | color2, | ||
| integer | color3, | ||
| number | u1, | ||
| number | v1, | ||
| number | u2, | ||
| number | v2, | ||
| number | u3, | ||
| number | v3 ) |
Draws a textured triangle.
| image | Image to draw triangle with. |
| x1 | X position of the first vertex. |
| y1 | Y position of the first vertex. |
| x2 | X position of the second vertex. |
| y2 | Y position of the second vertex. |
| x3 | X position of the third vertex. |
| y3 | Y position of the third vertex. |
| color1 | Color of the first vertex. |
| color2 | Color of the second vertex. |
| color3 | Color of the third vertex. |
| u1 | Texture U of the first vertex. |
| v1 | Texture V of the first vertex. |
| u2 | Texture U of the second vertex. |
| v2 | Texture V of the second vertex. |
| u3 | Texture U of the third vertex. |
| v3 | Texture V of the third vertex. |
| void Draw.UseDepthTesting | ( | boolean | useDepthTesting | ) |
Sets whether to do depth tests when drawing.
| useDepthTesting | Whether to do depth tests when drawing. |
| void Draw.UseFillSmoothing | ( | boolean | smoothFill | ) |
Sets whether to use smoothing when drawing filled shapes. (hardware-renderer only).
| smoothFill | Whether to use smoothing. |
| void Draw.UseSpriteDeform | ( | boolean | useDeform | ) |
Sets whether to use sprite deform when drawing.
| useDeform | Whether to use sprite deform when drawing. |
| void Draw.UseStencil | ( | boolean | enabled | ) |
Enables or disables stencil operations.
| enabled | Whether to enable or disable stencil operations. |
| void Draw.UseStrokeSmoothing | ( | boolean | smoothStroke | ) |
Sets whether to use smoothing when drawing un-filled shapes. (hardware-renderer only).
| smoothStroke | Whether to use smoothing. |
| void Draw.UseTinting | ( | boolean | useTinting | ) |
Sets whether to use color tinting when drawing.
| useTinting | Whether to use color tinting when drawing. |
| void Draw.View | ( | integer | viewIndex, |
| number | x, | ||
| number | y ) |
Draws a view.
| viewIndex | Index of the view. |
| x | X position of where to draw the view. |
| y | Y position of where to draw the view. |
| void Draw.ViewPart | ( | integer | viewIndex, |
| number | x, | ||
| number | y, | ||
| integer | partX, | ||
| integer | partY, | ||
| integer | partW, | ||
| integer | partH ) |
Draws part of a view.
| viewIndex | Index of the view. |
| x | X position of where to draw the view. |
| y | Y position of where to draw the view. |
| partX | X coordinate of part of view to draw. |
| partY | Y coordinate of part of view to draw. |
| partW | Width of part of view to draw. |
| partH | Height of part of view to draw. |
| void Draw.ViewPartSized | ( | integer | viewIndex, |
| number | x, | ||
| number | y, | ||
| integer | partX, | ||
| integer | partY, | ||
| integer | partW, | ||
| integer | partH, | ||
| number | width, | ||
| number | height ) |
Draws part of a view, but sized.
| viewIndex | Index of the view. |
| x | X position of where to draw the view. |
| y | Y position of where to draw the view. |
| partX | X coordinate of part of view to draw. |
| partY | Y coordinate of part of view to draw. |
| partW | Width of part of view to draw. |
| partH | Height of part of view to draw. |
| width | Width to draw the view. |
| height | Height to draw the view. |
| void Draw.ViewSized | ( | integer | viewIndex, |
| number | x, | ||
| number | y, | ||
| number | width, | ||
| number | height ) |
Draws a view, but sized.
| viewIndex | Index of the view. |
| x | X position of where to draw the view. |
| y | Y position of where to draw the view. |
| width | Width to draw the view. |
| height | Height to draw the view. |