Tommy
New Member
Posts: 17
|
Post by Tommy on Apr 17, 2005 21:47:54 GMT
Hi, I am playing around with tiled images and wanted to fill the whole screen with a tiled image. But it only fills the upper left quarter of the screen. Here is the code, based on the "images - tiled.bb" sample code.
Graphics3D 640, 480, 0, 2 : SetBuffer BackBuffer() ; INCLUDE SPRITE CANDY Include "../sprite candy.bb" ; CREATE CAMERA, LIGHT, BACKGROUND Cam = CreateCamera() ; CREATE THE HUD HUD% = HUD_Create (Cam) ; LOAD FONTS & IMAGES Resource1% = HUD_LoadImageResource ("Media/image1.png",4) ; <-- BLACK BECOMES TRANSPARENT ; CREATE LAYERS ImageLayer% = HUD_CreateLayer(HUD, Resource1) ; TILED IMAGE: w2% = 640 h2% = 480 Image% = HUD_CreateTiledImage (ImageLayer, 0,0, w2,h2, 0,277,64,64, "","") ; ------------------------------------------------------------------------ ; MAIN LOOP ; ------------------------------------------------------------------------ While Not KeyDown(1) HUD_Update : RenderWorld : Flip 0 Wend HUD_RemoveAll True : End
Any idea what I am doing wrong?
Cheers, Tommy
|
|
Ed-2D
Junior Member
Posts: 59
|
Post by Ed-2D on Apr 18, 2005 0:52:11 GMT
By default, an object's origin is placed in the middle of the object. There are two ways to fix it:
1- first solution
Image% = HUD_CreateTiledImage (ImageLayer, 0,0, w2,h2, 0,277,64,64, "CENTER","CENTER")
2- second solution
HUD_SetObjectOrigin ( Image, -1,-1 )
|
|
Tommy
New Member
Posts: 17
|
Post by Tommy on Apr 18, 2005 9:46:51 GMT
Thank you! I knew it must have been something simple!
Tommy
|
|