Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Gamewindow background not showing

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-25-2009, 07:29 PM
enonod's Avatar
Basic4ppc Veteran
 
Join Date: Oct 2007
Location: U.K.
Posts: 324
Default Gamewindow background not showing

I am having a little trouble putting a background image on a gamewindow.
I have added the gw object and no errors occur but neither does an image.
The image is in the same directory. It worked on an Image component.

Code:
    Form1.Show
gw.New1(
"Form1",0,0,321,321)
gw.DrawBackgroundImage(AppPath & 
"\grid 20x20.png")
I am having trouble adjusting from Delphi. I am unsure of the significance between adding an object from the IDE Tools Add Object menu, adding the DLL of the same name via the Tools Component menu etc.

Some help here please.
__________________
You never stop learning until you die.
Sometimes I think I am dead.
Sometimes others think I am dead!
Homesite: http://www.don-simmonds.co.uk for Libyan Mural

Device:Viewsonic VPad7, Android 2.2.2
Reply With Quote
  #2 (permalink)  
Old 06-26-2009, 05:33 AM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 978
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

I tried to use png in my game program and it works, however I had another case in which png format created problems,
Try to convert the image to jpg and see if it makes a difference.
__________________
David Erez
Ramat Hasharon, Israel
Reply With Quote
  #3 (permalink)  
Old 06-26-2009, 06:04 AM
enonod's Avatar
Basic4ppc Veteran
 
Join Date: Oct 2007
Location: U.K.
Posts: 324
Default

Thanks for the suggestion derez. I have now tried jpg and bmp but the image does not show. I must have missed a step but cannot find what. I used the 'Sprite' example to derive this test and used the same steps but there may be something hidden that is not in the actual code.
__________________
You never stop learning until you die.
Sometimes I think I am dead.
Sometimes others think I am dead!
Homesite: http://www.don-simmonds.co.uk for Libyan Mural

Device:Viewsonic VPad7, Android 2.2.2
Reply With Quote
  #4 (permalink)  
Old 06-26-2009, 08:22 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

This is the minimum needed to display a background.
Code:
Sub App_Start
    Form1.Show
    gw.New1(
"Form1",0,0,240,320)
    gw.DrawBackgroundImage(AppPath & 
"\grid 20x20.png")
    
doevents
    gw.tick
End Sub
You need "gw.tick" to force a redraw. Normally this would be in a timer. In this case as "gw.tick" is in App_Start the doevents is essential. I think this is because without it the Form doesn't actually get to draw itself until App_Start exits and then the normal Form drawing seems to take place after the game window drawing leaving a blank form. Having a doevents lets the Form do its' initial drawing and then "gw.tick" can do its' thing.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #5 (permalink)  
Old 06-26-2009, 11:09 AM
enonod's Avatar
Basic4ppc Veteran
 
Join Date: Oct 2007
Location: U.K.
Posts: 324
Default

Thank you very much agraham.
I think most problems I have are to do with understanding the cycle or sequence of things in B4PPC and what is essential. Is there somewhere that I could have found that information had I followed the right path?

[Edit] My interpretation of this situation is that I didn't actually go far enough by trying to see each stage happen as I code it.
__________________
You never stop learning until you die.
Sometimes I think I am dead.
Sometimes others think I am dead!
Homesite: http://www.don-simmonds.co.uk for Libyan Mural

Device:Viewsonic VPad7, Android 2.2.2

Last edited by enonod : 06-26-2009 at 11:12 AM.
Reply With Quote
  #6 (permalink)  
Old 06-26-2009, 11:21 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by enonod View Post
Is there somewhere that I could have found that information had I followed the right path?
Not directly. You need some knowledge of how Windows apps, which are event driven, are structured and the role of messages and the applications' message loop to understand how things interact to explain things like this.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Showing a Form eww245 Questions (Windows Mobile) 2 03-14-2009 10:38 AM
Open form not showing unless minimize first? tsteward Questions (Windows Mobile) 11 02-24-2009 08:43 AM
Showing time in textbox ??? Basseman Questions (Windows Mobile) 14 01-11-2009 04:03 PM
drawing on/in gamewindow enonod Questions (Windows Mobile) 2 05-25-2008 10:28 PM
Showing a form in a SelectionChanged event specci48 Questions (Windows Mobile) 3 05-18-2007 02:05 PM


All times are GMT. The time now is 04:33 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0