English Amiga Board


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

 
 
Thread Tools
Old 24 November 2017, 05:02   #1
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,542
Blitting part of a shape?

Basically - I have a health bar of sorts, which has a circular shape so I can't really use the scroll/blockscroll functions (eg I need to mask it)

So what I'd like to be able to is blit part of the health bar (varying the height).

Easiest way I can think of is to create 48 copies of the shape at different heights (as it's 48 pixels tall), but that sounds like an absurd waste of memory!

(Though I don't think my memory usage is high right now, so maybe I could get away with it)
earok is offline  
Old 24 November 2017, 12:33   #2
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
Try manipulating the shape structure by setting the pixheight property. This might have side-effects.
idrougge is offline  
Old 24 November 2017, 12:50   #3
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,336
I take it the health bar graphics can't be generated on the fly (plot/line/boxf etc.)? Possibly overkill, but you could use the stencil blitting commands, drawing on the stencil bitmap to "erase" parts of the blitted energy bar. That might be more suited to an energy bar on a separate display segment, as the stencil is applied to the whole display so it could be quite inefficient - it's not something I've tried.

Alternatively, have the full energy bar on one bitmap and grab a new shape with GetaShape of the relevant height each time you need to redraw it. You can use an independent buffer and BBlits to draw it so you can erase the previous bar before blitting the new one.
Daedalus is offline  
Old 01 December 2017, 03:45   #4
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,542
I've done it the inefficient way for now (taking a shape of every possible height).. memory wise it wasn't as hungry as I initially thought, I'll come back to this ^ if I end up needing to find more memory later.

Thanks for your input guys always appreciated
earok 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
[Found: Numerix] Obscure PD Shape Fitting Game manic23 Looking for a game name ? 19 30 March 2019 18:16
How do you get the Handle of an existing Shape? earok Coders. Blitz Basic 1 22 April 2017 11:00
Collective order: X500 Plus next gen case inspired to Amiga 500's shape Omolungo News 10 15 February 2013 23:59
Amiga Game Tools-Shape Grabber Joe Maroni request.Apps 0 22 October 2008 20:54
wtb: amiga 3000 desktop in great shape james 23703 MarketPlace 0 25 January 2006 02:26

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 05:20.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.06770 seconds with 15 queries