Sprites disappear (might be user error though).

Previous topic - Next topic

Hatonastick

This one seems odd.  My Star Pilot game which automatically adjusts to the screen size no longer draws any of the sprites when I do the following (although everything else works from my starfield to the HUD, all of which use the same screen size variables):

1. Set resolution (to anything, doesn't matter as we change it in the code with SETSCREEN) and full screen in the Project Options screen.
2. Use SETSCREEN to change it to the resolution I actually want.  Have it also select fullscreen.

Now originally I had the following:

1. Have resolution blanked out and full screen unchecked in Project Options screen.
2. Use SETSCREEN to set to the resolution I actually want.  Not fullscreen though.

That worked fine, right up until I decided to switch my game to fullscreen mode.  So when I added 'true' or '1' to SETSCREEN to make it go fullscreen I'd get this error message when I went to recompile: 'ERROR - Please set project settings for this platform'  It was to get rid of that error message that I switched to doing what I mention in the first section.

I hope this makes sense.  It has me scratching my head though.
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).

Quentin

not really sure what you're doing (some sample code would be helpful)

This small example works as expected (ver. 8.064 beta). I didn't change anything in the project options

Code (glbasic) Select

LOCAL mx%, my%, b1%, b2%
LOCAL mode%, sprite%

mode = FALSE

SETSCREEN 800, 600, mode

// sample graphic
DRAWRECT 0, 0, 100, 100, RGB(255, 255, 255)
sprite = GENSPRITE()
GRABSPRITE sprite, 0, 0, 100, 100

WHILE TRUE
PRINT "left mouse to toggle fullscreen/windowed mode", 0, 0
DRAWSPRITE sprite, 100, 100
MOUSESTATE mx, my, b1, b2
IF b1
IF mode = FALSE
mode = TRUE
ELSE
mode = FALSE
ENDIF
SETSCREEN 800, 600, mode
SLEEP 500
ENDIF
SHOWSCREEN
WEND

Kitty Hello

For a new platform, old project, you once have to set the resolution and stuff at start, so the compiler knows about that.

Hatonastick

Yeah I'll look into it again when I'm less tired.
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).

Hatonastick

Quote from: Kitty Hello on 2010-Aug-25
For a new platform, old project, you once have to set the resolution and stuff at start, so the compiler knows about that.
That's not happening for me.  It gives me that error every time I remove the resolution setting from Project Options now, whereas it was just fine about it before -- and I haven't changed anything else and it worked fine as is in the previous version of 8.  I don't like setting things via project options, I prefer using the SETSCREEN command at the top of my code.

Anyway I'll look at it again tomorrow.  Maybe I've done something stupid.  Suspect so since no-one else seems to have this issue.
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).

MrTAToad

I set my projects to the default resolution and then change it in program - before any screen resolution change, I make sure all graphics and sounds etc are deleted from memory and then re-loaded after the screen change.

Hatonastick

Ok I can report what Gernot and the rest of you already know -- there is no bug.  I finally took another look at it today (brain is less fuzzy) and lo-and-behold I discover I'm a twit.  I've been compiling and running the program from within the IDE and I've only just taken a look at the directory when I realised the "problem" is GLB seems to add underscores to application directories now as there was an entirely different application directory, which meant of course that it was missing media files eg. the sprite sheet.  ;/

Oh well.  Hopefully I'll think before I post next time.  Maybe.
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).

Ian Price

Yeah I noticed that too when I created a WIP with a space in it's name with V8.XXX.  I remember this was mentioned on the forums, but had forgotten about it - leading to exactly what you describe; a game running, with no media being broadcast.
I came. I saw. I played.