Using Flip at GameView library.

copiloto

Member
Licensed User
Longtime User
Hi,

Could someone post a little example of how to use Flip command at GameView library, please? I'm trying and trying and not got it.. Why its parameter is a int value?

Best regards.
 

copiloto

Member
Licensed User
Longtime User
Hi Erel,
In your example, I have added your line after smiley.Rotate and nothings happens to the smiley. Am I missing something trivial?

Thanks!


Sub Timer1_Tick
'code to calculate frames per second.
fps = (1000 / Max(10, (DateTime.Now - lastTime)) + 20 * fps) / 21
lblFPS.Text = NumberFormat(fps, 0, 0)
lastTime = DateTime.Now

'calculate the speed
If smiley.DestRect.Right > 99%x Then
vx = -1 * Abs(vx)
Else If smiley.DestRect.Left < 1%x Then
vx = Abs(vx)
End If
If smiley.DestRect.Bottom > 99%y Then
vy = -1 * Abs(vy)
Else If smiley.DestRect.Top < 1%y Then
vy = Abs(vy)
End If
'move the smiley
smiley.DestRect.Left = smiley.DestRect.Left + vx
smiley.DestRect.Top = smiley.DestRect.Top + vy
smiley.DestRect.Right = smiley.DestRect.Left + size
smiley.DestRect.Bottom = smiley.DestRect.Top + size
smiley.Rotate = (smiley.Rotate + 2) Mod 360 'rotate the smiley 2 degrees each tick
smiley.Flip = smiley.FLIP_VERTICALLY ''''''''''''''''''''''''''''''''''''''''''''''''''' NEW!

'scroll the background left
background.SrcRect.Left = (background.SrcRect.Left + 2dip) Mod (background.Bitmap.Width - 100%x / backgroundScale)
background.SrcRect.Right = background.SrcRect.Left + 100%x / backgroundScale

gv.Invalidate 'Mark the whole GameView as "dirty"
End Sub
 
Upvote 0

copiloto

Member
Licensed User
Longtime User
Erel, thanks for your answer. However it still doesn't take effect... I set timer to 200 in order to appreciate the flip effect but... nothing still happens. Does it works in your phone? It seems like if my sg3 wouldn't be compatible with this function?
 
Upvote 0
Top