|
Post by Wayne Rayner on Apr 10, 2010 0:02:33 GMT -5
Ok when I use the 800, 600 preset screen size and then create a image with the dimensions of 800,600 it has a effect like the image has being zoomed in on. Can someone please explain. here is the code (make sure to set the options on basic4GL compiler to the 800, 600 preset). dim tex(0), demo tex(0) = LoadTex("demo.png") demo = NewSprite (tex(0)) SprSetPos (400,300) SprSetSize (800, 600) and here is the image I hope someone can help me. Also is there a way to make the user change the screen resolution during the game? Yours Wayne Rayner
|
|
|
Post by matthew on Apr 10, 2010 4:13:34 GMT -5
The default sprite area in Basic4GL is 640px x 480px but you've changed it to 800px x 600px. Just change your code by adding the following line before you position the sprite on the screen. ResizeSpriteArea(800, 600)
As for your second question, I believe djlinux may have developed a plugin which allows you to change the screen size while a program is running.
|
|
|
Post by Wayne Rayner on Apr 10, 2010 4:18:36 GMT -5
Matthew once again I must thank you for your help. I knew there was something missing.
|
|
|
Post by Empyrion Martyr on Apr 10, 2010 4:33:41 GMT -5
DJLinux created a plugin that can change the screen size, when in windowed mode, however, without some serious messing around, you can't modify the resolution of the program while in fullscreen mode.
One way I found around this is to have several versions of your game:
game_800x600 game_1024x768 game_1280x1024 main_game.exe
Main_game.exe is what you launch allways. The others are standalone exe's created with those resolution modes, renamed to remove the ".exe". You use djlinux's plugin to Run any of the above when clicking your game's "Change resolution to ..." button, after renaming that file with the extension ".exe" (so the user doesn't feel tempted to just click on that at first).
However, make sure that you do this in the menu interfaces. If you do it ingame, launching the program would basically quit you from the current game you were playing. You would need to save your data and pass that as a parameter to the program if you do reset your resolution during an active game.
In any case, resetting the resolution does restart the main game in certain case (The First Person Shooter Will Rock and several other games) so I think this technique is a good workaround for the problem of resolution change.
|
|
|
Post by Wayne Rayner on Apr 10, 2010 5:05:52 GMT -5
Ok so it works in windowed mode thats awesonme at least for my simulation game. Well I will use the method you described for me. Although I will need help when it's near release phase if you wouldn't mind Empyrion Martyr?
|
|
|
Post by Empyrion Martyr on Apr 10, 2010 19:13:44 GMT -5
Ok so it works in windowed mode thats awesonme at least for my simulation game. Well I will use the method you described for me. Although I will need help when it's near release phase if you wouldn't mind Empyrion Martyr? Remeber that if you're using sprites extensively, changing the resolution would mess up your sprite locations on screen, if you're not careful. A game that is 1024x768, converted to a 800x600 might even not display your whole screen. Imagine you have a sprite placed at position 900,650. It would be outside the bounds of the new resolution, even after ResizeSpriteArea. Therefore, try to develop your game around the idea of changing resolutions. That is, allways use screenwise coordinates. Use SpriteAreaHeight, SpriteAreaWidth, etc when pluging in coordinates. For example, for a sprite in the lower right corner, use the following SprSetXCentre(0) SprSetYCentre(0) SprSetPos(SpriteAreaWidth()-SprXSize(),SpriteAreaHeight()-SprYSize())
But I'm sure you're aware of that. When you finish your project PM me, I'll try to help you with the techique I explained earlier.
|
|