Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QB Graphics for FB, preview release with source code
#11
i know you know this, but just a reminder...


PRINT STR$(num)
Reply
#12
that's how i got the program to print the fps. Smile
Jumping Jahoolipers!
Reply
#13
of course - slaps forehead


hey btw, how would i go about loading some pp256 graphics and palettes?
Reply
#14
Quote:of course - slaps forehead


hey btw, how would i go about loading some pp256 graphics and palettes?


http://www.qbtk.com/phpBB2/viewtopic.php?t=904

Did you miss this on qbtk?

:rotfl:
Reply
#15
Actually, the sprite format is identical to QB's for 8 bit sprites, so no conversion utility is needed. Also, the palette command and OUT/INP work exactly the same way too, so you should be able to load any of your palettes just as you used to in QB.

Quote:hey btw, how would i go about loading some pp256 graphics and palettes?
PP256 saves in BLOAD format, but FreeBASIC doesn't support BLOAD. Just open the file, skip 7 bytes, and read in your sprites. I'll write an example program.

Quote:Just a note, I'm pretty sure you know this already, but print will only support strings.
For now perhaps, but I intend to add PRINT functions for any/all datatypes. I'll have to anyway if/when PRINT hook(s) are added to FreeBASIC, at which point you'll be able to use PRINT as before instead of gfx_Print.
Reply
#16
Can InkeyTest.exe handle the arrow keys?

For all four keys, it returns CHR$(255) + the CHR value of the previous key for me. Sad
Reply
#17
Quote:Can InkeyTest.exe handle the arrow keys?

For all four keys, it returns CHR$(255) + the CHR value of the previous key for me. :(
Wow, I don't know what would make to do that... what happens if the first key you press is an arrow key?

On my computer:
Up shows Chr$(255) + "H"
Down: Chr$(255) + "P"
Left: Chr$(255) + "K"
Right: Chr$(255) + "M"
...no matter what the key before it was.

SDL key symbols match up with ASCII when they're under 127, so I check if the key symbol is <= 126 and if so I return Chr$ of that, otherwise Chr$(255) + Chr$(scancode)... I don't see how the previous key could possibly affect that... I need more info.

EDIT: Does the same/similar thing happen with this program?
You should get "&hff48" for up, "&hff50" for down, "&hff4b" for left, "&hff4d" for right.
Code:
'$include: "qbgfx4fb.bi"
defint a-z

Screen 12
gfx_Print "Press a key to see what Getkey returns:", 13

do
   Flip
   do: SDL_Delay 50: a = Getkey: loop until a
   gfx_Print "&h" + hex$(a), 13
loop until a = -1 or a = 27

end
Reply
#18
the arrow keys never really worked for me either. Note that i was using a laptop, so i had the numlock turned off.

Also, i'd like a function that can change the screen resolution. You know, for a full screen game. Maybe have it something like this?

screen 13, 1

the 1 would turn the screen to full screen. leaving it out would be windowed.

Just something i was thinking about. In qb, one could access a single byte of info from an array with varseg, varptr... with those commands not included, how could we access a single byte from an integer? (i.e. getting a single colour from a sprite.
Jumping Jahoolipers!
Reply
#19
Code:
PEEK (VARPTR(sprite%(0))+offset%)
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#20
Quote:Maybe have it something like this?

screen 13, 1

the 1 would turn the screen to full screen. leaving it out would be windowed.
Done. ScreenEx already accepted a fullscreenFlag parameter, but now I've added that to Screen too.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)