[10 Apr 2006] Layered brushes

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
User avatar
lazi
Posts: 650
Joined: Thu Feb 24, 2011 11:08 pm

[10 Apr 2006] Layered brushes

Post by lazi »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Mon, 10 Apr 2006 20:25:13 +0100

Hello!

I am porting a recent Hollywood 1.9 script to 2.0 and I had some difficulties.

I had a function that printed some text to a previously displayed brush by SelectBrush(). The changes made visible instantly. This time with Hollywood 2 I figured out that I have to redisplay the brush to show the changes. This way makes very hard to handle changes on overlapping brushes.

I cannot find any solution in the guide...

Why did you changed this, Andreas?
User avatar
airsoftsoftwair
Posts: 5914
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[11 Apr 2006] Re: Layered brushes

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 11 Apr 2006 12:14:13 +0200
Hello!

I am porting a recent Hollywood 1.9 script to 2.0 and I had some difficulties.

I had a function that printed some text to a previously displayed brush by SelectBrush(). The changes made visible instantly. This time with Hollywood 2 I figured out that I have to redisplay the brush to show the changes. This way makes very hard to handle changes on overlapping brushes.

I cannot find any solution in the guide...
There's no clean solution for it, I suppose. You should probably think of a better implementation.

A hacky way of getting the result would be:

Code: Select all

SelectBrush(1)
; make the changes to your brush
EndSelect

; Suppose brush 1 is layer 7
SelectBGPic(1)
RemoveLayer(7)   ; silent remove
EndSelect

InsertLayer(7, #BRUSH, 1, #CENTER, #CENTER)
That should do the job.
Why did you changed this, Andreas?
Well, this was a misbehaviour of Hollywood 1.x. Hollywood 2.0 has full layer substitution implemented, i.e. if you do something like

Code: Select all

EnableLayers
DisplayBrush(1, 0, 0)
FreeBrush(1)
The layer will still be there although brush 1 has been freed. A modification of the brush also triggers the internal layer substitution because you could have scaled, rotated, masked, etc. the brush and the layer system is not meant to dynamically adapt brushes when they're changed.
User avatar
lazi
Posts: 650
Joined: Thu Feb 24, 2011 11:08 pm

[14 Apr 2006] Re: Layered brushes

Post by lazi »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 14 Apr 2006 19:35:32 +0100

Hello Andreas!
There's no clean solution for it, I suppose. You should probably think of a better implementation.

A hacky way of getting the result would be:

Code: Select all

SelectBrush(1)
; make the changes to your brush
EndSelect

; Suppose brush 1 is layer 7
SelectBGPic(1)
RemoveLayer(7)   ; silent remove
EndSelect

InsertLayer(7, #BRUSH, 1, #CENTER, #CENTER)
That should do the job.
Yes, it worked, but it makes a short flash on the display.

So how should I implement classic Amiga like moving screens?

There is 3 screens on the display.

1. Background. This is a static bgpic.

2. A small horizontal user interface at the bottom. Sometimes it need to scroll down to show the full screen.

3. The main screen which holds the article and menu. This should be scroll out of the screen downward to redraw and then scroll back.

Do you have any idea for this problem?

Thanks your time!
User avatar
airsoftsoftwair
Posts: 5914
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[15 Apr 2006] Re: Re: Layered brushes

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 15 Apr 2006 22:21:35 +0200
So how should I implement classic Amiga like moving screens?

There is 3 screens on the display. 1. Background. This is a static bgpic.

2. A small horizontal user interface at the bottom. Sometimes it need to scroll down to show the full screen.

3. The main screen which holds the article and menu. This should be scroll out of the screen downward to redraw and then scroll back.

Do you have any idea for this problem?
Yes. Use sprites. Forget layers and use sprites. Create your small horizontal user interface as a sprite and use DisplaySprite() to scroll it down. Create all others elements that shall be moveable as sprites, too.

Sprites are useful not only for games as player and enemy gfx. You can also use them in applications. For example, the HollyAmp examples uses sprites for the position bar which you can drag around.
Locked