Calculator Community > HP Calculators

Hp Prime Questions and Help

(1/8) > >>

XiiDraco:
I've made this new topic here, to share knowledge and ask questions about the HP Prime, It's language (Prime BASIC?), and ways to go about certain things.

For Ex.

I have a question (seriously), How would I go about drawing text, sprites, and other objects to the screen?

DJ Omnimaga:
Have you checked the on-calc help by the way? The HP Prime wiki could be useful too http://tiplanet.org/hpwiki/index.php?title=HP_Prime/HP-BASIC , although it's incomplete. Just go to the commands menus then when hovering over a command with the arrows, press the Help button. They all have the syntax there.

However, in case you already checked that and it didn't work, could you share what troubles you had (source code)?

Sprites can be rather tricky because of the format. You need to convert images to HP Prime data using one of the converters there: http://ourl.ca/19398 (my favorite is Tim Wessman's because it has a GUI, but I like Jim Bauwens' too). To create one 16x16 sprite the code would look like this:

DIMGROB_P(G1, 16, 16, {#200420002000200:64h ,#200020002000200:64h ,#200020002000200:64h ,#200420002000200:64h ,#2007FE0020003E0:64h ,#200420002004200:64h ,#4200020002006378:64h ,#2007FE002000200:64h ,#2007FE0020003E0:64h ,#200020002000200:64h ,#20003E002000200:64h , #2007FE002000200:64h ,#200020002000200:64h ,#4200000002000210:64h ,#20003E002000200:64h ,#200020063780200:64h ,#200000002007FE0:64h ,#2000000020003E0:64h ,#200020002000200:64h ,#200021002000200:64h ,#200000002007FE0:64h ,#2000210020003E0:64h ,#20002007FE00200:64h , #200020003E00200:64h ,#6378020002000200:64h ,#20003E002000200:64h ,#420002007FE00200:64h ,#6378020003E00200:64h ,#200020042000200:64h ,#20003E002000200:64h ,#200020002000200:64h ,#200020002000000:64h ,#2007FE003E00200:64h ,#7FE0020042000200:64h ,#200020002000200:64h , #200020002000000:64h ,#2007FE003E00200:64h ,#7FE0020002000200:64h ,#3E0020063780200:64h ,#200420002000200:64h ,#200020002000200:64h ,#200020002006378:64h ,#3E0020002000000:64h ,#200020002000200:64h ,#200020003E00200:64h ,#200020002007FE0:64h ,#2007FE002000000:64h , #200420002000200:64h ,#200020003E00200:64h ,#3E0021002007FE0:64h ,#2007FE002000200:64h ,#200020003E00200:64h ,#200420002000200:64h ,#3E0020002000200:64h ,#200420002000200:64h ,#200020003E00200:64h ,#200021063780200:64h ,#200020042000200:64h ,#4200020002000200:64h , #200021002000200:64h ,#200020002000200:64h ,#200020002000200:64h ,#200020002000200:64h ,#200020002000200:64h });


To display it somewhere on the screen you need to do something like BLIT_P(G0,100,100,116,116,G1,0,0,16,16);

XiiDraco:
Ok sweet that's really helpful. + I didn't know you could use the help section on the cmds. XD

Expect Abandoned for Hp Prime :P

DJ Omnimaga:
Oh also btw you can store as many sprites as you want in one GROB, but you can only store about 15 at once in one DIMGROB_P command. It's possible to have more than that by creating a massive GROB (for example, using DIMGROB_P(G2,16,1024); ) then creating one set of sprite in G1, copying it in G2, creating another in G1, copying it after the other, and so on.


As for transparency, for example if you use red, you should setup the 2nd GROB like this:
DIMGROB_P(G2,16,1024,RGB(255,0,0,128));

Basically it sets the background color to red, but transparent. Do not use White, though, else it won't work.


Here's some code example at http://ourl.ca/19698/362793 but I might use those sprites in a game.

As for Abandoned it would probably be possible, but try to keep your graphics small and have no rotation. It's best to start with smaller projects too in case, and experiment.

XiiDraco:
You lost me pretty quick. XD Anyway ya, I'm probably going to keep small sprites, finite worlds, no multiplayer, and no sprite rotation.

Navigation

[0] Message Index

[#] Next page

Go to full version