05 November 2019, 17:22 | #1 |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
Using sprites for HUD etc.
How would one go about setting up sprites to use for a HUD or the like? Say I wanted to use four 16px wide sprites to make a HUD that is 64px wide, how would I then draw images and text to the sprites making up the HUD?
|
05 November 2019, 17:35 | #2 |
Warhasneverbeensomuchfun
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
|
You create the sprites and draw them as needed... I am not sure I understood your question.
I know the game looks shit, but the numbers on the above portion of screen are sprites. Each digit is a sprite. |
05 November 2019, 17:49 | #3 |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
Thanks, I was thinking about the possibility to manipulate sprite data like bitmaps, to have a more "dynamic" sprite built of shapes and text etc.
|
05 November 2019, 17:51 | #4 |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
The HUD on Rod-Land is what I would like to achieve, might be too complicated: https://codetapper.com/amiga/sprite-tricks/rod-land/
|
05 November 2019, 17:58 | #5 |
Warhasneverbeensomuchfun
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
|
Oh I see.
You can draw the sprites and then blit the extra info (Scores / lives etc) on top of it. Or I believe you could have a bitmap where you draw the stuff you want, use the GetaSprite command to make a sprite out of it and draw it on screen as a sprite. I dont think it would be faster than just blitting over the sprite though. Though if you want to scroll the rest of the screen, it would be a better way to do it, as you can scroll the bitmap and keep the sprites intact. |
05 November 2019, 22:36 | #6 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,381
|
You can do it very easily by drawing directly to shapes (ShapesBitMap, MakeCookie), then transferring the image data to the sprite using GetaSprite. This copies the image data, so it's not entirely efficient, but if it's a relatively small amount of information the time taken should be minimal.
I haven't tried it, but to actually draw directly to the sprite image data, you could use CludgeBitmap, which sets up a bitmap object but doesn't allocate any memory for it. Instead, you give it a pointer to already-allocated memory, such as manually decoded image data, or the bitmap of a sprite. Code:
myBitMap.l = Peek.l(ADDR Sprite 0) CludgeBitmap 0, 16, 16, 2, myBitMap |
06 November 2019, 08:13 | #7 |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
Thanks guys! CludgeBitmap seems to be what I'm looking for. I'll have a go at it and report back!
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Some sprites | Frog | project.Sprites | 6 | 22 August 2022 20:01 |
Requesting a specific HUD part from Alien Breed 3D | dex | project.Sprites | 10 | 08 February 2011 21:37 |
Where to get GfxRip and Sprites | Joe Maroni | project.Sprites | 0 | 11 November 2006 13:02 |
Hacked Sprites | The Master | Looking for a game name ? | 2 | 15 May 2006 17:20 |
Where are all the sprites? | Gambit37 | project.Sprites | 8 | 14 October 2005 14:49 |
|
|