View Single Post
  #3 (permalink)  
Old 06-16-2008, 04:37 PM
fjsantos fjsantos is offline
Junior Member
 
Join Date: May 2008
Posts: 19
Default

Hi Klaus

Thanks for helping.

Code is a bit large so I extract important part.

Code:
Sub App_Start
	GameFormLib.New1("GameForm", B4PObject(1))
	GameGameWindow.New1("GameForm", 0, 0, WIDTH, HEIGHT)
	GameGameWindow.DrawBackgroundImage(AppPath & "\images\backdrop.png")
	ObjectDoor.New1(False)
	ObjectDoor.FromControl("GameForm")
	ObjectDoor.SetProperty("KeyPreview", True)
	TmpBackdropBitmap.New1(AppPath & "\images\backdrop.png")
	GameForm.Image = TmpBackdropBitmap.Value
	GameForm.Show
	GameForm.ForeLayer = True
	CreateCloseButton
	CreateNewCell
	UpdateForm1
	MoveCellTimer.Enabled = True
End Sub

Sub UpdateForm1
	CellBitmap.New1(AppPath & "\images\cell.png")
	CellRectangle.New1(0, 0, CellBitmap.Width, CellBitmap.Height)
	BackdropRectangle.New1(0, 0, CellBitmap.Width, CellBitmap.Height)
	GameFormDrawer.New1("GameForm", True)
End Sub

Sub UpdateForm(x, y)
	BackdropRectangle.X = x
	BackdropRectangle.Y = y
	GameFormDrawer.DrawImage1(CellBitmap.Value, CellRectangle.Value, BackdropRectangle.Value, False)
	GameFormDrawer.Refresh2(BackdropRectangle.Value)
	GameGameWindow.DrawBackgroundImage2(GameForm.Image)
End Sub
The first time GameGameWindow draws GameForm.Image all seems to be ok, but the second one, its fails 'Parameter is not valid'.

Thanks, fjsantos.
Reply With Quote