22 December 2018, 03:02 | #1 |
Registered User
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
|
Blitz- cannot blit a shape
Hi,
Where do I have a mistake in the following code? At the end, there is a BLIT command which shows nothing.... but... When I replace it with BLOCK everything works. Code:
BLITZ BlitzKeys On InitCopList 0,$0014 CreateDisplay 0 BitMap 0,320,256,4 DisplayBitMap 0,0 InitShape 0,32,16,4 ShapesBitMap 0,1 BitMapOutput 1 Locate 0,0 Print "test" Free BitMap 1 Use BitMap 0 While Joyb(0)=0 If RawStatus($45) Then Goto finito If RawStatus($50) Then Blit 0,0,0 ;BLOCK works here Wend finito: End |
22 December 2018, 04:29 | #2 |
Warhasneverbeensomuchfun
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
|
I believe you have to add a displaybitmap command inside your while loop to see the result of the blit on the.bitmap
|
22 December 2018, 09:50 | #3 | |
Registered User
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
|
Quote:
Just added DisplayBitMap after Blit but it did not change anything. Still Block command seems to work but Blit doesnt. There is one more thing, if I get and use a shape with GetaShape command (from pre-made graphics) then Blit works fine |
|
22 December 2018, 10:54 | #4 |
Banana
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,213
|
I've never had initshape / shapebitmap working. It works the other way around - draw to a bitmap and get the shape.
|
22 December 2018, 11:57 | #5 |
Registered User
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
|
Looks like a good idea.
Thanks |
29 March 2021, 19:52 | #6 | |
Registered User
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
|
Quote:
Looks like quite accidentally I found the way to make ShapesBitMap work. The wrong way: Code:
BitMap 1,16,16,4 GetaShape 1,0,0,15,15 Free BitMap 1 ShapesBitMap 1,1 Use Bitmap 1 Boxf 0,0,15,15,5 ;<-- this will never show up on shape 1 Free Bitmap 1 Code:
BitMap 1,16,16,4 Boxf 0,0,15,15,7 ;<--- this line is required, that's all GetaShape 1,0,0,15,15 ;the new shape cannot be transparrent Free BitMap 1 ;for ShapesBitMap to work ShapesBitMap 1,1 Use Bitmap 1 Boxf 0,0,15,15,5 Free Bitmap 1 |
|
29 March 2021, 22:13 | #7 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
|
Totally missed this thread back in the day, but it's probably that your shape doesn't have a cookie associated with it, meaning when you blit it, it's transparent. Drawing the box forces it because it's not transparent from the start, but try adding
Code:
MakeCookie 1 |
30 March 2021, 08:57 | #8 |
Registered User
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
|
Ha,
you are right! MakeCookie is the way to go. |
10 April 2021, 23:56 | #9 |
Registered User
Join Date: Mar 2018
Location: Austria
Posts: 615
|
Related to this:
Can you blit shapes opaque (so colour 0 gets written to target and is not transparent) without using "block"? What I tried: When you turn Autocookie off before GetAShape, so the shape is without cookie and blit the shape normally, you wont see anything. I expected the blit to be full-size and opaque without cookie, but seems that in that case it doesnt blit anything. (Which matches your post #7 Daedalus). Changing blitmode to solidMode didnt help either. All the pixels contained in the cookie received the highest colour (all the bitplanes get switched to 1). Is this intended behaviour or do I miss something? It works with block but is there a way using a normal blit command? |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to calculate possible blit times? | Tigerskunk | Coders. Asm / Hardware | 32 | 11 January 2022 08:24 |
[Found: Numerix] Obscure PD Shape Fitting Game | manic23 | Looking for a game name ? | 19 | 30 March 2019 18:16 |
Blitting part of a shape? | earok | Coders. Blitz Basic | 3 | 01 December 2017 03:45 |
How do you get the Handle of an existing Shape? | earok | Coders. Blitz Basic | 1 | 22 April 2017 11:00 |
Can amiblitz (blitz basic2) blit an image per bitplane? | Michael Parent | Coders. General | 7 | 29 October 2009 17:59 |
|
|