English Amiga Board

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

Thread Tools
Old 24 November 2017, 06:02   #1
Registered User

Join Date: Dec 2013
Location: Auckland
Posts: 1,595
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  
AdSense AdSense  
Old 24 November 2017, 13:33   #2
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 3,274
Try manipulating the shape structure by setting the pixheight property. This might have side-effects.
idrougge is offline  
Old 24 November 2017, 13:50   #3
Registered User

Daedalus's Avatar
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 2,580
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, 04:45   #4
Registered User

Join Date: Dec 2013
Location: Auckland
Posts: 1,595
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  
AdSense AdSense  

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you get the Handle of an existing Shape? earok Coders. Blitz Basic 1 22 April 2017 12:00
Obscure PD Shape Fitting Game manic23 Looking for a game name ? 17 03 May 2014 01:52
Collective order: X500 Plus next gen case inspired to Amiga 500's shape Omolungo News 10 16 February 2013 00:59
Amiga Game Tools-Shape Grabber Joe Maroni request.Apps 0 22 October 2008 21:54
wtb: amiga 3000 desktop in great shape james 23703 MarketPlace 0 25 January 2006 03: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 22:06.

Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Page generated in 0.20645 seconds with 14 queries