English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 05 November 2019, 18:22   #1
MickGyver
Registered User

MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 546
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?
MickGyver is offline  
Old 05 November 2019, 18:35   #2
Shatterhand
Warhasneverbeensomuchfun

Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 36
Posts: 3,437
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.
Shatterhand is offline  
Old 05 November 2019, 18:49   #3
MickGyver
Registered User

MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 546
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.
MickGyver is offline  
Old 05 November 2019, 18:51   #4
MickGyver
Registered User

MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 546
The HUD on Rod-Land is what I would like to achieve, might be too complicated: https://codetapper.com/amiga/sprite-tricks/rod-land/
MickGyver is offline  
Old 05 November 2019, 18:58   #5
Shatterhand
Warhasneverbeensomuchfun

Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 36
Posts: 3,437
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.
Shatterhand is offline  
Old 05 November 2019, 23:36   #6
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 4,439
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
should give you the image data pointer, then create bitmap object ID 0 (16x16, 4 colour) at that location, allowing you to draw to it at will. Bear in mind that that will update in realtime on the screen, so you might want to synchronise your drawing with VWait.
Daedalus is offline  
Old 06 November 2019, 09:13   #7
MickGyver
Registered User

MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 546
Thanks guys! CludgeBitmap seems to be what I'm looking for. I'll have a go at it and report back!
MickGyver is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Requesting a specific HUD part from Alien Breed 3D dex project.Sprites 10 08 February 2011 22:37
Where to get GfxRip and Sprites Joe Maroni project.Sprites 0 11 November 2006 14:02
Hacked Sprites The Master Looking for a game name ? 2 15 May 2006 18:20
Where are all the sprites? Gambit37 project.Sprites 8 14 October 2005 15:49
Some sprites Frog project.Sprites 5 06 April 2005 01:35

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 21:34.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.07960 seconds with 13 queries