Drawing an image flipped left-right?
BlitzMax Forums/OpenGL Module/Drawing an image flipped left-right?
| ||
I want to be able to draw an image flipped over left-right. Setscale(-1,1) doesn't do anything. EDIT: Wait, yes it does. My code was screwy. Never mind :) |
| ||
I don't know that this'll solve the problem, but tryglDisable( GL_CULL_FACE ) |
| ||
SetScale works fine...doesn't this work for you?Graphics 640,480,0,0 DrawText "Hello",100,100 img:TImage = CreateImage(50,15) GrabImage(img,100,100) xspeed = 2 yspeed = 2 Repeat Cls x :+ xspeed y :+ yspeed If x>GraphicsWidth()-ImageWidth(img) Or x<0 xspeed = -xspeed EndIf If y>GraphicsHeight()-ImageHeight(img) Or y<0 yspeed = -yspeed EndIf SetScale -1,1 DrawImage img,x,y Flip Until KeyHit(KEY_ESCAPE) |
| ||
slight mod to fredborgs code:Graphics 640,480,0,0 DrawText "BlitzMAX",100,100 img:TImage = CreateImage(50,15) GrabImage(img,100,100) xspeed = 2 yspeed = 2 Repeat Cls x :+ xspeed y :+ yspeed If x>GraphicsWidth()-ImageWidth(img) Or x<0 xspeed = -xspeed EndIf If y>GraphicsHeight()-ImageHeight(img) Or y<0 yspeed = -yspeed EndIf SetColor spam,spam,255 spam = spam + 1 If spam > 360 Then spam = 0 SetScale Sin(spam)*6,Cos(spam)*6 DrawImage img,x,y Flip Until KeyHit(KEY_ESCAPE) |
| ||
He said he got it working |
| ||
Woot! I forgot about that till now! Right on! Thanks for the refresher! |