Legacy:Image/blit
From Spherical
< Legacy:Image
Revision as of 02:44, 27 March 2013 by Flying Jester (talk | contribs) (Created page with "Draw the image onto the screen. =Usage= ::''image''.blit(''x'', ''y''); * '''image''' Sphere Image object. The image to draw on screen. * '''x''' number. The x coordinat...")
Draw the image onto the screen.
Contents
Usage
- image.blit(x, y);
- image Sphere Image object. The image to draw on screen.
- x number. The x coordinate of the top-left corner of the drawn image.
- y number. The y coordinate of the top-left corner of the drawn image.
Examples
This simple game will take an image and blit it onto the screen..
function game()
{
var w = GetScreenWidth();
var h = GetScreenHeight();
var img = LoadImage("my_test_image.png");
//Blit the image.
img.blit(16, 16);
FlipScreen();
GetKey();
}
Notes
- Image.blitMask() can also be used to blit an image to the screen, but with a tinting color.
See also
- Sphere Image object
- FlipScreen()
- GetKey()
- GetScreenHeight()
- GetScreenWidth()
- LoadImage()