The VCSSL Graphics2D library is one of the standard libraries for handling graphics in VCSSL,and provides animation-capable 2D computer graphics (2DCG) rendering functions.
Because the Graphics2D library is relatively large, it is difficult to use it effectively by referring only to the function specifications described here.For specific usage examples and guidance, refer to the "Official VCSSL 2DCG Development Guide."
- None -
- None -
| Name | newGraphics2DRenderer |
| Declaration | int newGraphics2DRenderer( int width, int height, int graphicsID ) |
| Description | Creates a 2DCG renderer and returns its unique identifier, called the renderer ID. |
| Parameters |
(int type) width : The width of the drawing area. (int type) height : The height of the drawing area. (int type) graphicsID : The ID of the graphics resource to use. |
| Return | (int type) The renderer ID. |
| Name | deleteGraphics2DRenderer |
| Declaration | void deleteGraphics2DRenderer( int rendererID ) |
| Description | Disposes a 2DCG renderer. |
| Parameters | (int type) rendererID : The ID of the renderer to dispose. |
| Return | (void type) |
| Name | paintGraphics2D |
| Declaration | macro paintGraphics2D( int rendererID ) |
| Description | Composites sprites and renders the 2DCG scene. |
| Parameters | (int type) rendererID : The renderer ID. |
| Name | clearGraphics2D |
| Declaration | macro clearGraphics2D( int rendererID ) |
| Description | Clears the drawing contents with the background color. |
| Parameters | (int type) rendererID : The renderer ID. |
| Name | clearGraphics2D |
| Declaration | macro clearGraphics2D( int rendererID, bool removeAll ) |
| Description | Clears the drawing contents with the background color and, if necessary, removes all mounted sprites. |
| Parameters |
(int type) rendererID : The renderer ID. (bool type) removeAll : Whether to remove all mounted sprites. |
| Name | setGraphics2DColor |
| Declaration | macro setGraphics2DColor( int rendererID, int red, int green, int blue, int alpha ) |
| Description | Sets the background color. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) red : The red component (0 to 255). (int type) green : The green component (0 to 255). (int type) blue : The blue component (0 to 255). (int type) alpha : The alpha component (0 to 255). |
| Name | setGraphics2DColor |
| Declaration | void setGraphics2DColor( int rendererID, int rgba[ ] ) |
| Description | Sets the background color. |
| Parameters |
(int type) rendererID : The renderer ID. (int[] type) rgba : The array storing the color components ([0]=red, [1]=green, [2]=blue, [3]=alpha, each ranging from 0 to 255). |
| Return | (void type) |
| Name | setGraphics2DSize |
| Declaration | macro setGraphics2DSize( int rendererID, int width, int height ) |
| Description | Sets the size of the drawing area. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) width : The width. (int type) height : The height. |
| Name | setDrawColor |
| Declaration | macro setDrawColor( int rendererID, int red, int green, int blue, int alpha ) |
| Description | Sets the drawing color. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) red : The red component (0 to 255). (int type) green : The green component (0 to 255). (int type) blue : The blue component (0 to 255). (int type) alpha : The alpha component (0 to 255). |
| Name | setDrawColor |
| Declaration | void setDrawColor( int rendererID, int rgba[ ] ) |
| Description | Sets the drawing color. |
| Parameters |
(int type) rendererID : The renderer ID. (int[] type) rgba : The array storing the color components ([0]=red, [1]=green, [2]=blue, [3]=alpha, each ranging from 0 to 255). |
| Return | (void type) |
| Name | setDrawFont |
| Declaration | void setDrawFont( int rendererID, string name ) |
| Description | Sets the font used for text drawing. |
| Parameters |
(int type) rendererID : The renderer ID. (string type) name : The font name. This depends on the implementation and environment. |
| Return | (void type) |
| Name | setDrawFontSize |
| Declaration | void setDrawFontSize( int rendererID, int size ) |
| Description | Sets the size of the font used for text drawing. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) size : The font size. |
| Return | (void type) |
| Name | setDrawFontBold |
| Declaration | void setDrawFontBold( int rendererID, bool isBold ) |
| Description | Enables or disables bold style for the font used in text drawing. It cannot be used together with italic style. |
| Parameters |
(int type) rendererID : The renderer ID. (bool type) isBold : Whether bold style is enabled. |
| Return | (void type) |
| Name | setDrawFontItalic |
| Declaration | void setDrawFontItalic( int rendererID, bool isItalic ) |
| Description | Enables or disables italic style for the font used in text drawing. It cannot be used together with bold style. |
| Parameters |
(int type) rendererID : The renderer ID. (bool type) isItalic : Whether italic style is enabled. |
| Return | (void type) |
| Name | drawPoint |
| Declaration | void drawPoint( int rendererID, int vertex_x, int vertex_y, int radius, bool fill ) |
| Description | Draws a point. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) vertex_x : The X coordinate of the center. (int type) vertex_y : The Y coordinate of the center. (int type) radius : The radius. (bool type) fill : Whether to fill the point. |
| Return | (void type) |
| Name | drawLine |
| Declaration | macro drawLine( int rendererID, int vertex_x1, int vertex_y1, int vertex_x2, int vertex_y2 ) |
| Description | Draws a straight line segment. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) vertex_x1 : The X coordinate of the first endpoint. (int type) vertex_y1 : The Y coordinate of the first endpoint. (int type) vertex_x2 : The X coordinate of the second endpoint. (int type) vertex_y2 : The Y coordinate of the second endpoint. |
| Name | drawLine |
| Declaration | macro drawLine( int rendererID, int vertex_x1, int vertex_y1, int vertex_x2, int vertex_y2, int lineWidth ) |
| Description | Draws a straight line segment with an arbitrary thickness. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) vertex_x1 : The X coordinate of the first endpoint. (int type) vertex_y1 : The Y coordinate of the first endpoint. (int type) vertex_x2 : The X coordinate of the second endpoint. (int type) vertex_y2 : The Y coordinate of the second endpoint. (int type) lineWidth : The line thickness. |
| Name | drawEllipse |
| Declaration | macro drawEllipse( int rendererID, int vertex_x, int vertex_y, int width, int height, bool fill ) |
| Description | Draws an ellipse. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) vertex_x : The X coordinate of the top-left corner of the bounding rectangle. (int type) vertex_y : The Y coordinate of the top-left corner of the bounding rectangle. (int type) width : The width of the bounding rectangle. (int type) height : The height of the bounding rectangle. (bool type) fill : Whether to fill the ellipse. |
| Name | drawRectangle |
| Declaration | macro drawRectangle( int rendererID, int vertex_x, int vertex_y, int width, int height, bool fill ) |
| Description | Draws a rectangle. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) vertex_x : The X coordinate of the top-left corner. (int type) vertex_y : The Y coordinate of the top-left corner. (int type) width : The width of the bounding rectangle. (int type) height : The height of the bounding rectangle. (bool type) fill : Whether to fill the rectangle. |
| Name | drawPolyline |
| Declaration | macro drawPolyline( int rendererID, int vertex_x[ ], int vertex_y[ ] ) |
| Description | Draws a polyline. |
| Parameters |
(int type) rendererID : The renderer ID. (int[] type) vertex_x : The array storing the X coordinates of vertices. (int[] type) vertex_y : The array storing the Y coordinates of vertices. |
| Name | drawPolyline |
| Declaration | macro drawPolyline( int rendererID, int vertex_x[ ], int vertex_y[ ], int lineWidth ) |
| Description | Draws a polyline with an arbitrary thickness. |
| Parameters |
(int type) rendererID : The renderer ID. (int[] type) vertex_x : The array storing the X coordinates of vertices. (int[] type) vertex_y : The array storing the Y coordinates of vertices. (int type) lineWidth : The line thickness. |
| Name | drawPolygon |
| Declaration | macro drawPolygon( int rendererID, int vertex_x[ ], int vertex_y[ ], bool fill ) |
| Description | Draws a polygon. |
| Parameters |
(int type) rendererID : The renderer ID. (int[] type) vertex_x : The array storing the X coordinates of vertices. (int[] type) vertex_y : The array storing the Y coordinates of vertices. (bool type) fill : Whether to fill the polygon. |
| Name | drawPolygon |
| Declaration | macro drawPolygon( int rendererID, int vertex_x[ ], int vertex_y[ ], int lineWidth ) |
| Description | Draws a polygon with an arbitrary thickness. |
| Parameters |
(int type) rendererID : The renderer ID. (int[] type) vertex_x : The array storing the X coordinates of vertices. (int[] type) vertex_y : The array storing the Y coordinates of vertices. (int type) lineWidth : The line thickness. |
| Name | drawText |
| Declaration | macro drawText( int rendererID, int vertex_x, int vertex_y, string textString ) |
| Description | Draws a single line of text. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) vertex_x : The X coordinate of the text starting position. (int type) vertex_y : The Y coordinate of the text starting position. (string type) textString : The text content. |
| Name | drawText |
| Declaration | macro drawText( int rendererID, int vertex_x, int vertex_y, int width, int height, string textString ) |
| Description | Draws text over multiple lines with wrapping. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) vertex_x : The X coordinate of the text starting position. (int type) vertex_y : The Y coordinate of the text starting position. (int type) width : The line width. (int type) height : The line height. (string type) textString : The text content. |
| Name | drawImage |
| Declaration | macro drawImage( int rendererID, int vertex_x, int vertex_y, int graphicsID ) |
| Description | Draws an image. The drawing result of another 2D or 3D renderer can also be composited and drawn as an image. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) vertex_x : The X coordinate of the top-left corner. (int type) vertex_y : The Y coordinate of the top-left corner. (int type) graphicsID : The ID of the graphics resource storing the image. |
| Name | drawImage |
| Declaration | macro drawImage( int rendererID, int vertex_x, int vertex_y, int width, int height, int graphicsID ) |
| Description | Draws an image after resizing it. The drawing result of another 2D or 3D renderer can also be composited and drawn as an image. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) vertex_x : The X coordinate of the top-left corner. (int type) vertex_y : The Y coordinate of the top-left corner. (int type) width : The width. (int type) height : The height. (int type) graphicsID : The ID of the graphics resource storing the image. |
| Name | drawImage |
| Declaration | void drawImage( int rendererID, int x, int y, int width, int height, int cropX, int cropY, int cropWidth, int cropHeight, int graphicsID ) |
| Description | Draws a cropped portion of an image. The drawing result of another 2D or 3D renderer can also be composited and drawn as an image.In VCSSL 3.4.8 and earlier, the behavior of this function differed from the argument descriptions in the documentation.In VCSSL 3.4.10, the behavior was corrected to match the documentation.If you need the behavior of VCSSL 3.4.8 or earlier, replace calls to this function with calls to drawGraphics instead. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) x : The X coordinate of the top-left corner of the drawing position. (int type) y : The Y coordinate of the top-left corner of the drawing position. (int type) width : The drawing width. (int type) height : The drawing height. (int type) cropX : The X coordinate of the top-left corner of the source region. (int type) cropY : The Y coordinate of the top-left corner of the source region. (int type) cropWidth : The width of the source region. (int type) cropHeight : The height of the source region. (int type) graphicsID : The ID of the graphics resource storing the image. |
| Return | (void type) |
| Name | setPixel |
| Declaration | macro setPixel( int rendererID, int red[ ][ ], int green[ ][ ], int blue[ ][ ], int alpha[ ][ ] ) |
| Description | Directly sets the drawing contents from pixel color-component arrays. |
| Parameters |
(int type) rendererID : The renderer ID. (int[][] type) red : The array storing the red components ([Y][X], values from 0 to 255). (int[][] type) green : The array storing the green components ([Y][X], values from 0 to 255). (int[][] type) blue : The array storing the blue components ([Y][X], values from 0 to 255). (int[][] type) alpha : The array storing the alpha components ([Y][X], values from 0 to 255). |
| Name | setPixel |
| Declaration | macro setPixel( int rendererID, int rgba[ ][ ][ ] ) |
| Description | Directly sets the drawing contents from a pixel color-component array. |
| Parameters |
(int type) rendererID : The renderer ID. (int[][][] type) rgba : The array storing the color components ([Y][X][0:red, 1:green, 2:blue, 3:alpha], values from 0 to 255). |
| Name | drawPixel |
| Declaration | void drawPixel( int rendererID, int x, int y, int red[ ][ ], int green[ ][ ], int blue[ ][ ], int alpha[ ][ ] ) |
| Description | Draws the contents of pixel color-component arrays on top of the current drawing contents. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) x : The X coordinate of the top-left corner. (int type) y : The Y coordinate of the top-left corner. (int[][] type) red : The array storing the red components ([Y][X], values from 0 to 255). (int[][] type) green : The array storing the green components ([Y][X], values from 0 to 255). (int[][] type) blue : The array storing the blue components ([Y][X], values from 0 to 255). (int[][] type) alpha : The array storing the alpha components ([Y][X], values from 0 to 255). |
| Return | (void type) |
| Name | drawPixel |
| Declaration | void drawPixel( int rendererID, int x, int y, int rgba[ ][ ][ ] ) |
| Description | Draws the contents of a pixel color-component array on top of the current drawing contents. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) x : The X coordinate of the top-left corner. (int type) y : The Y coordinate of the top-left corner. (int[][][] type) rgba : The array storing the color components ([Y][X][0:red, 1:green, 2:blue, 3:alpha], values from 0 to 255). |
| Return | (void type) |
| Name | drawPixel |
| Declaration | void drawPixel( int rendererID, int x, int y, int width, int height, int red[ ][ ], int green[ ][ ], int blue[ ][ ], int alpha[ ][ ] ) |
| Description | Resizes the contents of pixel color-component arrays and draws them on top of the current drawing contents. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) x : The X coordinate of the top-left corner. (int type) y : The Y coordinate of the top-left corner. (int type) width : The width. (int type) height : The height. (int[][] type) red : The array storing the red components ([Y][X], values from 0 to 255). (int[][] type) green : The array storing the green components ([Y][X], values from 0 to 255). (int[][] type) blue : The array storing the blue components ([Y][X], values from 0 to 255). (int[][] type) alpha : The array storing the alpha components ([Y][X], values from 0 to 255). |
| Return | (void type) |
| Name | drawPixel |
| Declaration | void drawPixel( int rendererID, int x, int y, int width, int height, int rgba[ ][ ][ ] ) |
| Description | Resizes the contents of a pixel color-component array and draws them on top of the current drawing contents. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) x : The X coordinate of the top-left corner. (int type) y : The Y coordinate of the top-left corner. (int type) width : The width. (int type) height : The height. (int[][][] type) rgba : The array storing the color components ([Y][X][0:red, 1:green, 2:blue, 3:alpha], values from 0 to 255). |
| Return | (void type) |
| Name | drawPixel |
| Declaration | void drawPixel( int rendererID, int x, int y, int width, int height, int baseX, int baseY, int baseWidth, int baseHeight, int red[ ][ ], int green[ ][ ], int blue[ ][ ], int alpha[ ][ ] ) |
| Description | Extracts a specified region from pixel color-component arrays and draws it on top of the current drawing contents. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) x : The X coordinate of the top-left corner. (int type) y : The Y coordinate of the top-left corner. (int type) width : The width. (int type) height : The height. (int type) baseX : The X coordinate of the top-left corner of the source region. (int type) baseY : The Y coordinate of the top-left corner of the source region. (int type) baseWidth : The width of the source region. (int type) baseHeight : The height of the source region. (int[][] type) red : The array storing the red components ([Y][X], values from 0 to 255). (int[][] type) green : The array storing the green components ([Y][X], values from 0 to 255). (int[][] type) blue : The array storing the blue components ([Y][X], values from 0 to 255). (int[][] type) alpha : The array storing the alpha components ([Y][X], values from 0 to 255). |
| Return | (void type) |
| Name | drawPixel |
| Declaration | void drawPixel( int rendererID, int x, int y, int width, int height, int baseX, int baseY, int baseWidth, int baseHeight, int rgba[ ][ ][ ] ) |
| Description | Extracts a specified region from a pixel color-component array and draws it on top of the current drawing contents. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) x : The X coordinate of the top-left corner. (int type) y : The Y coordinate of the top-left corner. (int type) width : The width. (int type) height : The height. (int type) baseX : The X coordinate of the top-left corner of the source region. (int type) baseY : The Y coordinate of the top-left corner of the source region. (int type) baseWidth : The width of the source region. (int type) baseHeight : The height of the source region. (int[][][] type) rgba : The array storing the color components ([Y][X][0:red, 1:green, 2:blue, 3:alpha], values from 0 to 255). |
| Return | (void type) |
| Name | getPixel |
| Declaration | int[ ][ ][ ] getPixel( int rendererID ) |
| Description | Converts the contents of the drawing area into a pixel color-component array and returns it. |
| Parameters | (int type) rendererID : The renderer ID. |
| Return | (int[][][] type) The pixel color-component array ([Y][X][0:red, 1:green, 2:blue, 3:alpha], values from 0 to 255). |
| Name | getPixelRed |
| Declaration | int[ ][ ] getPixelRed( int rendererID ) |
| Description | Converts the contents of the drawing area into an array of red pixel components and returns it. |
| Parameters | (int type) rendererID : The renderer ID. |
| Return | (int[][] type) The array of red pixel components ([Y][X], values from 0 to 255). |
| Name | getPixelGreen |
| Declaration | int[ ][ ] getPixelGreen( int rendererID ) |
| Description | Converts the contents of the drawing area into an array of green pixel components and returns it. |
| Parameters | (int type) rendererID : The renderer ID. |
| Return | (int[][] type) The array of green pixel components ([Y][X], values from 0 to 255). |
| Name | getPixelBlue |
| Declaration | int[ ][ ] getPixelBlue( int rendererID ) |
| Description | Converts the contents of the drawing area into an array of blue pixel components and returns it. |
| Parameters | (int type) rendererID : The renderer ID. |
| Return | (int[][] type) The array of blue pixel components ([Y][X], values from 0 to 255). |
| Name | getPixelAlpha |
| Declaration | int[ ][ ] getPixelAlpha( int rendererID ) |
| Description | Converts the contents of the drawing area into an array of alpha pixel components and returns it. |
| Parameters | (int type) rendererID : The renderer ID. |
| Return | (int[][] type) The array of alpha pixel components ([Y][X], values from 0 to 255). |
| Name | newPointSprite |
| Declaration | int newPointSprite( int x, int y, int radius, bool fill ) |
| Description | Creates a point sprite and returns its unique identifier, called the sprite ID. |
| Parameters |
(int type) x : The X coordinate of the top-left corner of the bounding rectangle. (int type) y : The Y coordinate of the top-left corner of the bounding rectangle. (int type) radius : The radius. (bool type) fill : Whether to fill the sprite. |
| Return | (int type) The sprite ID. |
| Name | newLineSprite |
| Declaration | int newLineSprite( int x1, int y1, int x2, int y2 ) |
| Description | Creates a line-segment sprite and returns its unique identifier, called the sprite ID. |
| Parameters |
(int type) x1 : The X coordinate of the first endpoint. (int type) y1 : The Y coordinate of the first endpoint. (int type) x2 : The X coordinate of the second endpoint. (int type) y2 : The Y coordinate of the second endpoint. |
| Return | (int type) The sprite ID. |
| Name | newEllipseSprite |
| Declaration | int newEllipseSprite( int x, int y, int width, int height, bool fill ) |
| Description | Creates an ellipse sprite and returns its unique identifier, called the sprite ID. |
| Parameters |
(int type) x : The X coordinate of the top-left corner of the bounding rectangle. (int type) y : The Y coordinate of the top-left corner of the bounding rectangle. (int type) width : The width of the bounding rectangle. (int type) height : The height of the bounding rectangle. (bool type) fill : Whether to fill the sprite. |
| Return | (int type) The sprite ID. |
| Name | newRectangleSprite |
| Declaration | int newRectangleSprite( int x, int y, int width, int height, bool fill ) |
| Description | Creates a rectangle sprite and returns its unique identifier, called the sprite ID. |
| Parameters |
(int type) x : The X coordinate of the top-left corner. (int type) y : The Y coordinate of the top-left corner. (int type) width : The width of the bounding rectangle. (int type) height : The height of the bounding rectangle. (bool type) fill : Whether to fill the sprite. |
| Return | (int type) The sprite ID. |
| Name | newPolylineSprite |
| Declaration | int newPolylineSprite( int x[ ], int y[ ] ) |
| Description | Creates a polyline sprite and returns its unique identifier, called the sprite ID. |
| Parameters |
(int[] type) x : The array storing the X coordinates of vertices. (int[] type) y : The array storing the Y coordinates of vertices. |
| Return | (int type) The sprite ID. |
| Name | newPolygonSprite |
| Declaration | int newPolygonSprite( int x[ ], int y[ ], bool fill ) |
| Description | Creates a polygon sprite and returns its unique identifier, called the sprite ID. |
| Parameters |
(int[] type) x : The array storing the X coordinates of vertices. (int[] type) y : The array storing the Y coordinates of vertices. (bool type) fill : Whether to fill the sprite. |
| Return | (int type) The sprite ID. |
| Name | newImageSprite |
| Declaration | int newImageSprite( int x, int y, int width, int height, int graphicsID ) |
| Description | Creates an image sprite and returns its unique identifier, called the sprite ID. |
| Parameters |
(int type) x : The X coordinate of the top-left corner. (int type) y : The Y coordinate of the top-left corner. (int type) width : The width of the bounding rectangle. (int type) height : The height of the bounding rectangle. (int type) graphicsID : The ID of the graphics resource storing the image. |
| Return | (int type) The sprite ID. |
| Name | newTextSprite |
| Declaration | int newTextSprite( int x, int y, int width, int height, string text ) |
| Description | Creates a text sprite and returns its unique identifier, called the sprite ID. |
| Parameters |
(int type) x : The X coordinate of the text starting position. (int type) y : The Y coordinate of the text starting position. (int type) width : The line width. (int type) height : The line height. (string type) text : The text content. |
| Return | (int type) The sprite ID. |
| Name | deleteSprite |
| Declaration | void deleteSprite( int spriteID ) |
| Description | Disposes a sprite. |
| Parameters | (int type) spriteID : The ID of the target sprite. |
| Return | (void type) |
| Name | mountSprite |
| Declaration | void mountSprite( int spriteID, int rendererID ) |
| Description | Mounts a sprite onto a renderer. |
| Parameters |
(int type) spriteID : The ID of the target sprite. (int type) rendererID : The renderer ID. |
| Return | (void type) |
| Name | demountSprite |
| Declaration | void demountSprite( int spriteID, int rendererID ) |
| Description | Demounts a sprite from a renderer. |
| Parameters |
(int type) spriteID : The ID of the target sprite. (int type) rendererID : The renderer ID. |
| Return | (void type) |
| Name | setSpriteDepth |
| Declaration | macro setSpriteDepth( int spriteID, double vertex_z ) |
| Description | Sets the depth of a sprite. A larger depth value places the sprite farther back, and a smaller value places it closer to the front. |
| Parameters |
(int type) spriteID : The ID of the target sprite. (double type) vertex_z : The depth. |
| Name | setSpriteLocation |
| Declaration | macro setSpriteLocation( int spriteID, int vertex_x, int vertex_y ) |
| Description | Sets the position of a sprite. |
| Parameters |
(int type) spriteID : The ID of the target sprite. (int type) vertex_x : The X coordinate of the top-left corner. (int type) vertex_y : The Y coordinate of the top-left corner. |
| Name | setSpriteSize |
| Declaration | void setSpriteSize( int spriteID, int size ) |
| Description | Sets the size of a sprite. This function is used for sprites whose size can be specified by a single parameter, such as point sprites. |
| Parameters |
(int type) spriteID : The ID of the target sprite. (int type) size : The radius. |
| Return | (void type) |
| Name | setSpriteSize |
| Declaration | macro setSpriteSize( int spriteID, int width, int height ) |
| Description | Sets the size of a sprite. |
| Parameters |
(int type) spriteID : The ID of the target sprite. (int type) width : The width. (int type) height : The height. |
| Name | setSpriteClip |
| Declaration | macro setSpriteClip( int spriteID, int clip_x, int clip_y, int clip_width, int clip_height ) |
| Description | Sets the clipping information of a sprite. |
| Parameters |
(int type) spriteID : The ID of the target sprite. (int type) clip_x : The X coordinate of the clipping area. (int type) clip_y : The Y coordinate of the clipping area. (int type) clip_width : The width of the clipping area. (int type) clip_height : The height of the clipping area. |
| Name | setSpriteColor |
| Declaration | macro setSpriteColor( int spriteID, int red, int green, int blue, int alpha ) |
| Description | Sets the color of a sprite. |
| Parameters |
(int type) spriteID : The ID of the target sprite. (int type) red : The red component (0 to 255). (int type) green : The green component (0 to 255). (int type) blue : The blue component (0 to 255). (int type) alpha : The alpha component (0 to 255). |
| Name | setSpriteColor |
| Declaration | void setSpriteColor( int spriteID, int rgba[ ] ) |
| Description | Sets the color of a sprite. |
| Parameters |
(int type) spriteID : The ID of the target sprite. (int[] type) rgba : The array storing the color components ([0]=red, [1]=green, [2]=blue, [3]=alpha, each ranging from 0 to 255). |
| Return | (void type) |
| Name | setSpriteFill |
| Declaration | macro setSpriteFill( int spriteID, bool fillState ) |
| Description | Sets whether the sprite is filled. |
| Parameters |
(int type) spriteID : The ID of the target sprite. (bool type) fillState : Whether the sprite is filled. |
| Name | setSpriteText |
| Declaration | macro setSpriteText( int spriteID, string textString ) |
| Description | Sets the text of a sprite. |
| Parameters |
(int type) spriteID : The ID of the target sprite. (string type) textString : The text content. |
| Name | setSpriteImage |
| Declaration | macro setSpriteImage( int spriteID, int graphicsID ) |
| Description | Sets the image of a sprite. |
| Parameters |
(int type) spriteID : The ID of the target sprite. (int type) graphicsID : The ID of the graphics resource storing the image. |
| Name | setSpriteFont |
| Declaration | void setSpriteFont( int spriteID, string name ) |
| Description | Sets the font used for sprite text drawing. |
| Parameters |
(int type) spriteID : The ID of the target sprite. (string type) name : The font name. This depends on the implementation and environment. |
| Return | (void type) |
| Name | setSpriteFontSize |
| Declaration | void setSpriteFontSize( int spriteID, int size ) |
| Description | Sets the size of the font used for sprite text drawing. |
| Parameters |
(int type) spriteID : The ID of the target sprite. (int type) size : The font size. |
| Return | (void type) |
| Name | setSpriteFontBold |
| Declaration | void setSpriteFontBold( int spriteID, bool isBold ) |
| Description | Enables or disables bold style for the font used in sprite text drawing. It cannot be used together with italic style. |
| Parameters |
(int type) spriteID : The ID of the target sprite. (bool type) isBold : Whether bold style is enabled. |
| Return | (void type) |
| Name | setSpriteFontItalic |
| Declaration | void setSpriteFontItalic( int spriteID, bool isItalic ) |
| Description | Enables or disables italic style for the font used in sprite text drawing. It cannot be used together with bold style. |
| Parameters |
(int type) spriteID : The ID of the target sprite. (bool type) isItalic : Whether italic style is enabled. |
| Return | (void type) |
| Name | drawOval |
| Declaration | macro drawOval( int rendererID, int vertex_x, int vertex_y, int width, int height, bool fill ) |
| Description | Draws an ellipse.The newer drawEllipse function has been supported since VCSSL 3.3.24.This function is supported for compatibility. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) vertex_x : The X coordinate of the top-left corner of the bounding rectangle. (int type) vertex_y : The Y coordinate of the top-left corner of the bounding rectangle. (int type) width : The width of the bounding rectangle. (int type) height : The height of the bounding rectangle. (bool type) fill : Whether to fill the ellipse. |
| Name | drawRect |
| Declaration | macro drawRect( int rendererID, int vertex_x, int vertex_y, int width, int height, bool fill ) |
| Description | Draws a rectangle.The newer drawRectangle function has been supported since VCSSL 3.3.24.This function is supported for compatibility. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) vertex_x : The X coordinate of the top-left corner. (int type) vertex_y : The Y coordinate of the top-left corner. (int type) width : The width of the bounding rectangle. (int type) height : The height of the bounding rectangle. (bool type) fill : Whether to fill the rectangle. |
| Name | drawGraphics |
| Declaration | macro drawGraphics( int rendererID, int vertex_x, int vertex_y, int graphicsID ) |
| Description | Draws the contents of graphics data generated from the drawing result of another renderer or from an image file.The newer drawImage function has been supported since VCSSL 3.3.24.This function is supported for compatibility. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) vertex_x : The X coordinate of the top-left corner. (int type) vertex_y : The Y coordinate of the top-left corner. (int type) graphicsID : The graphics resource ID. |
| Name | drawGraphics |
| Declaration | macro drawGraphics( int rendererID, int vertex_x, int vertex_y, int width, int height, int graphicsID ) |
| Description | Draws resized contents of graphics data generated from the drawing result of another renderer or from an image file.The newer drawImage function has been supported since VCSSL 3.3.24.This function is supported for compatibility. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) vertex_x : The X coordinate of the top-left corner. (int type) vertex_y : The Y coordinate of the top-left corner. (int type) width : The width. (int type) height : The height. (int type) graphicsID : The graphics resource ID. |
| Name | drawGraphics |
| Declaration | void drawGraphics( int rendererID, int fromLeftTopX, int fromLeftTopY, int fromRightBottomX, int fromRightBottmY, int toLeftTopX, int toLeftTopY, int toRightBottmX, int toRightBottomY, int graphicsID ) |
| Description | Draws a specified region extracted from graphics data generated from the drawing result of another renderer or from an image file.The newer drawImage function has been supported since VCSSL 3.3.24.This function is supported for compatibility.In VCSSL 3.4.8 and earlier, the documented explanation of the arguments for this function was incorrect, so the documentation was corrected in VCSSL 3.4.10. Therefore, the behavior of this function itself has not changed.On the other hand, the newer drawImage function was changed so that its behavior matches the original documentation.Therefore, use this function when compatibility with older programs is important, and use drawImage in new programs. |
| Parameters |
(int type) rendererID : The renderer ID. (int type) fromLeftTopX : The X coordinate of the top-left corner of the cropped area in the source image. (int type) fromLeftTopY : The Y coordinate of the top-left corner of the cropped area in the source image. (int type) fromRightBottomX : The X coordinate of the lower-right corner of the cropped area in the source image. fromRightBottomY : The Y coordinate of the lower-right corner of the cropped area in the source image. (int type) toLeftTopX : The X coordinate of the top-left corner of the drawing position. (int type) toLeftTopY : The Y coordinate of the top-left corner of the drawing position. toRightBottomX : The X coordinate of the lower-right corner of the drawing position. (int type) toRightBottomY : The Y coordinate of the lower-right corner of the drawing position. (int type) graphicsID : The graphics resource ID storing the source image. |
| Return | (void type) |
| Name | newOvalSprite |
| Declaration | int newOvalSprite( int x, int y, int width, int height, bool fill ) |
| Description | Creates an ellipse sprite and returns its unique identifier, called the sprite ID.The newer newEllipseSprite function has been supported since VCSSL 3.3.24.This function is supported for compatibility. |
| Parameters |
(int type) x : The X coordinate of the top-left corner of the bounding rectangle. (int type) y : The Y coordinate of the top-left corner of the bounding rectangle. (int type) width : The width of the bounding rectangle. (int type) height : The height of the bounding rectangle. (bool type) fill : Whether to fill the sprite. |
| Return | (int type) The sprite ID. |
| Name | newRectSprite |
| Declaration | int newRectSprite( int x, int y, int width, int height, bool fill ) |
| Description | Creates a rectangle sprite and returns its unique identifier, called the sprite ID.The newer newRectangleSprite function has been supported since VCSSL 3.3.24.This function is supported for compatibility. |
| Parameters |
(int type) x : The X coordinate of the top-left corner. (int type) y : The Y coordinate of the top-left corner. (int type) width : The width of the bounding rectangle. (int type) height : The height of the bounding rectangle. (bool type) fill : Whether to fill the sprite. |
| Return | (int type) The sprite ID. |
| Name | newGraphicsSprite |
| Declaration | int newGraphicsSprite( int x, int y, int width, int height, int graphicsID ) |
| Description | Creates an image sprite and returns its unique identifier, called the sprite ID.The newer newImageSprite function has been supported since VCSSL 3.3.24.This function is supported for compatibility. |
| Parameters |
(int type) x : The X coordinate of the top-left corner. (int type) y : The Y coordinate of the top-left corner. (int type) width : The width of the bounding rectangle. (int type) height : The height of the bounding rectangle. (int type) graphicsID : The graphics resource ID. |
| Return | (int type) The sprite ID. |
| Name | addSprite |
| Declaration | void addSprite( int spriteID, int rendererID ) |
| Description | Mounts a sprite. The newer mountSprite function has been supported since VCSSL 3. This function is supported for compatibility. |
| Parameters |
(int type) spriteID : The ID of the target sprite. (int type) rendererID : The renderer ID. |
| Return | (void type) |
| Name | removeSprite |
| Declaration | void removeSprite( int spriteID, int rendererID ) |
| Description | Demounts a sprite. The newer demountSprite function has been supported since VCSSL 3. This function is supported for compatibility. |
| Parameters |
(int type) spriteID : The ID of the target sprite. (int type) rendererID : The renderer ID. |
| Return | (void type) |
| Name | setSpriteGraphics |
| Declaration | macro setSpriteGraphics( int spriteID, int graphicsID ) |
| Description | Sets the graphics data of a sprite.The newer setSpriteImage function has been supported since VCSSL 3.3.24.This function is supported for compatibility. |
| Parameters |
(int type) spriteID : The ID of the target sprite. (int type) graphicsID : The graphics resource ID. |
| Name | newLayer |
| Declaration | int newLayer() |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Return | (int type) |
| Name | deleteLayer |
| Declaration | void deleteLayer( int spriteID ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Return | (void type) |
| Name | mountLayer |
| Declaration | void mountLayer( int spriteID, int rendererID ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Return | (void type) |
| Name | addLayer |
| Declaration | void addLayer( int spriteID, int rendererID ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Return | (void type) |
| Name | demountLayer |
| Declaration | void demountLayer( int spriteID, int rendererID ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Return | (void type) |
| Name | removeLayer |
| Declaration | void removeLayer( int spriteID, int rendererID ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Return | (void type) |
| Name | setLayerDepth |
| Declaration | macro setLayerDepth( int spriteID, double vertex_z ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Name | setLayerLocation |
| Declaration | macro setLayerLocation( int spriteID, int vertex_x, int vertex_y ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Name | setLayerSize |
| Declaration | macro setLayerSize( int spriteID, int width, int height ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Name | setLayerClipping |
| Declaration | macro setLayerClipping( int spriteID, int clip_x, int clip_y, int clip_width, int clip_height ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Name | setLayerColor |
| Declaration | macro setLayerColor( int spriteID, int red, int green, int blue, int alpha ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Name | setLayerFill |
| Declaration | macro setLayerFill( int spriteID, bool fillState ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Name | setLayerText |
| Declaration | macro setLayerText( int spriteID, string textString ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Name | setLayerGraphics |
| Declaration | macro setLayerGraphics( int spriteID, int graphicsID ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Name | setLayerFont |
| Declaration | void setLayerFont( int spriteID, string name ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Return | (void type) |
| Name | setLayerFontSize |
| Declaration | void setLayerFontSize( int spriteID, int size ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Return | (void type) |
| Name | setLayerFontBold |
| Declaration | void setLayerFontBold( int spriteID, bool b ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Return | (void type) |
| Name | setLayerFontItalic |
| Declaration | void setLayerFontItalic( int spriteID, bool b ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Return | (void type) |
| Name | newOvalLayer |
| Declaration | int newOvalLayer( int x, int y, int width, int height, bool fill ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Return | (int type) |
| Name | newRectLayer |
| Declaration | int newRectLayer( int x, int y, int width, int height, bool fill ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Return | (int type) |
| Name | newLineLayer |
| Declaration | int newLineLayer( int x1, int y1, int x2, int y2 ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Return | (int type) |
| Name | newPolylineLayer |
| Declaration | int newPolylineLayer( int x[ ], int y[ ] ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Return | (int type) |
| Name | newPolygonLayer |
| Declaration | int newPolygonLayer( int x[ ], int y[ ], bool fill ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Return | (int type) |
| Name | newGraphicsLayer |
| Declaration | int newGraphicsLayer( int x, int y, int width, int height, int graphicsID ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Return | (int type) |
| Name | newTextLayer |
| Declaration | int newTextLayer( int x, int y, int width, int height, string text ) |
| Description | The use of this function is not recommended. This function is supported for compatibility. |
| Return | (int type) |