TileImage |
TileImage ImageNumber, Xpos, Ypos, SolidFlag |
|
Parameters: ImageNumber = The identifier of this image Xpos = The X coordinate to begin tiling the image at Ypos = The Y coordinate to begin tiling the image at SolidFlag = The solid flag toggles if the image is to be rendered solid (no transparent parts) or not
|
Returns: NONE |
|
Unlike the DrawImage commands, which render the image once, TileImage will render the image at the starting coordinates then continue drawing it across and down. Thus tiling the current output surface (the screen or image) with an image. Making ideal for drawing repetitive patterns.
FACTS:
* TileImage is not supported by the Scene or World Buffer systems.
Mini Tutorial:
This small example shows how to create a small image, draw a circle to it, then create a scrolling effect using tile image.
; Create an Image of a Circle Size=100 CreateImage 1,Size,Size RenderToImage 1 CircleC Size/2,Size/2,size/2,0,RGB(0,255,0) ; redirect All drawing to the Screen. RenderToScreen ; Set the program to run at a max of 60 Frames per second SetFPS 60 ; Start a loop Do ; Clear the screen to black Cls RGB(0,0,0) ; Render our image of a circle to the screen repeatably TileImage 1,X,Y,0 ; Increaes the X variable (to Create the illusion of scrolling along the X axis x=Mod(x+1,size) ; Increaes the X variable (to Create the illusion of scrolling along the X axis y=Mod(y+1,size) ; Display the screen and loop until the users presses the ESC key. Sync Loop |
|
|
Example Source: Download This Example ; ================================================================== ; ScrollIMage (convert a colour image to black and white) ; ================================================================== ; Create a variable called size an assign this variable the value 256. Size=240 ; Create a new image of size and return it's handle into the ball variable Ball=NewImage(Size,Size) ; Render a purple colour phong map styled shading to the image RenderPhongImage Ball,size/2,size/2,$ff04ff,Size*0.9,2.0 Do Cls RGB(30,25,40) ; Calc the center of the sreen scx=(GetScreenWidth()/2) scy=(GetScreenHeight()/2) ; Render Our Created image to the screen DrawImage ball,scx-size/2,scy-size/2,1 CenterText scx,scy,"Scrolling Image" ; Scroll the Pixel Data through the IMage. ScrollImage Ball,2,2 ; Display the Screen and loop back to the Do statement to continue. Sync Loop |
|