Line 59:
Line 59:
::::: Oh yea! I think I figured it out! TEX_BACKGROUND = loadTexture("background.png"); is this: drawTexture(TEX_BACKGROUND, 0, 0, 1, 1, 20, 20, 255); and it uses that as a background is that right? aww maan it doesnt read it correctly --[[User:Labtech9998|Labtech9998]] 00:39, 1 October 2009 (UTC)
::::: Oh yea! I think I figured it out! TEX_BACKGROUND = loadTexture("background.png"); is this: drawTexture(TEX_BACKGROUND, 0, 0, 1, 1, 20, 20, 255); and it uses that as a background is that right? aww maan it doesnt read it correctly --[[User:Labtech9998|Labtech9998]] 00:39, 1 October 2009 (UTC)
+
+
::::: Yes, you need to load the texture outside the "function draw()", and then you can use it. drawTexture has 8 parameters:
+
* 1: Texture reference.
+
* 2-5: Texture coordinates, 0,0 is the upper left corner, 1,1 the bottom right. So 0,0,1,1 is the whole texture.
+
* 6-7: Size of the drawn 'object' on the screen.
+
* 8: 'Alpha' aka, transparency, 0 to 255, 0 is full transparent, 255 is not transparent.
+
--[[User:Daid|Daid]] 08:25, 1 October 2009 (UTC)
== A Restart button when pausing! ==
== A Restart button when pausing! ==