[22 Apr 2006] More questions :)

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
Oliver

[22 Apr 2006] More questions :)

Post by Oliver »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 22 Apr 2006 17:57:47 +0100

Hidiho,

Well my frontend project is growing, I am currently in a cleanup and optimize phase (yesterday I discovered the wonderfull world of arrays, even if I probably don`t understand it fully yet, it allready made things much easier, instead of dozens of lines with display brush and make button functions, I just have single lines + array to create them, great :) )

However, there is one thing which really drives me mad.

First have a look on this Screenshot: http://www.oli-.de/temp/scumm_hollywood.jpg

Do you notice those ugly black border around those alpha Icons? This happens when I click them several times or move the mousepointer over it. It seems as if the alpha channel is painted over and over again.

this is the function for hover and onclick i use: (Scumm launch is currently disabled again)

Code: Select all

Function p_knopf(msg)

        Switch msg.action
        Case "OnMouseOver":
                CopyBrush (msg.id, 101)
                TintBrush (101, #WHITE, 40)
                DisplayBrush (101, msg.x, msg.y)
                FreeBrush(101)
        Case "OnMouseOut":
                DisplayBrush (msg.id, msg.x, msg.y)
        Case "OnMouseDown":
                CopyBrush (msg.id, 101)
                TintBrush (101, #BLACK, 40)
                DisplayBrush (101, msg.x, msg.y)
                FreeBrush(101)
        Case "OnMouseUp":
                CopyBrush (msg.id, 101)
                TintBrush (101, #WHITE, 40)
                DisplayBrush (101, msg.x, msg.y)
                FreeBrush(101)
        EndSwitch

EndFunction 
I hoped by freeing the brush this will be gone, however it wasn`t

So has anyone an Idea how I could enhance this function so it works better with alpha Images? I did of course also look into those example scripts, but didn`t find the right thing to solve that. I also thought about using sprites instead of brushes, but then I won`t have this tint function ;)

Another question is more general, (for another project I have in mind) I didn`t find anything about an arexx Implementation, so I guess it simply isn`t there. But wouldn`t it be cool to have hollywood progs which can comunicate with other apps?

My last question (for today ;) ) Is also more related to Hollywood development in General (and probably completly against the philosophy behind Hollwood ;) )

As far as I understand, with Hollywood V2 AGA Support was completly removed and a gfx card is neccesary. While this abolutley makes sense for all this modern Amiga Stuff, it is a real killer for the good old classics. Don`t get me wrong, I have myself a Pegasos, and I like it, and the G4 is powerfull enough for all this stuff, but... well I have also this nice littly CD 32 here... ;) (beside several other classics) And I dream since years to make my own small game especially for the CD32, as it is also years ago since the last game for the CD 32 apeared, Nowadays even the Homebrew community for Atari`s Jaguar is bigger and much more productive (and they have real problems with all their modul stuff and such) However up to now I didn`t get this far with all those other programming languages, Hollywood otoh gives real fast results.

So I wonder if it` s even possible to make some special optimized routines for Hollywood which get out everything from those little old gems? I am afraid the answer is no here, however, at least I did ask ;)

regards Oliver
PEB
Posts: 591
Joined: Sun Feb 21, 2010 1:28 am

[22 Apr 2006] Re: More questions :)

Post by PEB »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 22 Apr 2006 10:21:52 -0700 (PDT)

Hi Oliver,

The alpha icon problem that you describe can be fixed by tinting the layer instead of the brush.

Try something like this:

Code: Select all

LoadBrush(1, "MyBrush.png", {LoadAlpha=True})
InsertLayer(1, #BRUSH, 1, #CENTER, #CENTER, TRUE)
SetLayerName(1,"MyBrush")

Function p_knopf(msg)
  Switch msg.action
  Case "OnMouseOver":
    SetLayerTint("MyBrush",#WHITE,128)
  Case "OnMouseOut":
    SetLayerTint("MyBrush",#WHITE,0)
  EndSwitch
EndFunction
Notice that when you use SetLayerTint(), you do not need to free or redisplay anything.

Hope this works for you!
PEB
Posts: 591
Joined: Sun Feb 21, 2010 1:28 am

[22 Apr 2006] Re: Re: More questions :)

Post by PEB »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 22 Apr 2006 10:40:11 -0700 (PDT)

One quick correction to the code I suggested. The second line should have been:

Code: Select all

InsertLayer(1, #BRUSH, 1, #CENTER, #CENTER, FALSE)
...otherwise you would have to add:

Code: Select all

ShowLayer("MyBrush")
after naming the layer.
Oliver

[22 Apr 2006] Re: More questions :)

Post by Oliver »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 22 Apr 2006 19:31:53 +0100

Hi Paul, Ah ok, I didn`t look to the layers chapter very much until now. Guess this will be my lesson for today then ;) Thanks for your help

regards Oliver
User avatar
airsoftsoftwair
Posts: 5914
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[22 Apr 2006] Re: More questions :)

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 22 Apr 2006 20:38:51 +0200
Hidiho,

Well my frontend project is growing, I am currently in a cleanup and optimize phase (yesterday I discovered the wonderfull world of arrays, even if I probably don`t understand it fully yet, it allready made things much easier, instead of dozens of lines with display brush and make button functions, I just have single lines + array to create them, great :) )

However, there is one thing which really drives me mad.

First have a look on this Screenshot: http://www.oli-.de/temp/scumm_hollywood.jpg

Do you notice those ugly black border around those alpha Icons? This happens when I click them several times or move the mousepointer over it. It seems as if the alpha channel is painted over and over again.
Yes. Remember that if you display a brush that has an alpha channel, it is mixed with the background. On the first display operation, the background is of blue color and your brush is displayed correctly, but on the next calls to DisplayBrush(), the background is no longer plain blue but already contains the formerly displayed brushes. Thus, the more times you call DisplayBrush(), the worse your result gets.

The solution is quite easy, draw to a temporary brush with a solid blue background and then display this brush.

For instance:

Code: Select all

CreateBrush(500, msg.width, msg.height, <insert background color here>)
SelectBrush(500)
CopyBrush (msg.id, 101)
TintBrush (101, #WHITE, 40)
DisplayBrush (101, 0, 0)
FreeBrush(101)
EndSelect

DisplayBrush(500, msg.x, msg.y)
So has anyone an Idea how I could enhance this function so it works better with alpha Images? I did of course also look into those example scripts, but didn`t find the right thing to solve that. I also thought about using sprites instead of brushes, but then I won`t have this tint function ;)
Sprites would be indeed the easiest way. You can tint the brush using TintBrush() first and then convert it to a sprite using CreateSprite(). If you use sprites, the different button states are represented by different frames of a sprite. You can then switch the frames around using the fourth argument of DisplaySprite().

e.g.

Code: Select all

frame 1 could be no button is active
frame 2 could be button #1 is active
frame 3 could be button #2 is active
... 
Another question is more general, (for another project I have in mind) I didn`t find anything about an arexx Implementation, so I guess it simply isn`t there. But wouldn`t it be cool to have hollywood progs which can comunicate with other apps?
ARexx support is in the works.
My last question (for today ;) ) Is also more related to Hollywood development in General (and probably completly against the philosophy behind Hollwood ;) )

As far as I understand, with Hollywood V2 AGA Support was completly removed and a gfx card is neccesary. While this abolutley makes sense for all this modern Amiga Stuff, it is a real killer for the good old classics. Don`t get me wrong, I have myself a Pegasos, and I like it, and the G4 is powerfull enough for all this stuff, but... well I have also this nice littly CD 32 here... ;) (beside several other classics) And I dream since years to make my own small game especially for the CD32, as it is also years ago since the last game for the CD 32 apeared, Nowadays even the Homebrew community for Atari`s Jaguar is bigger and much more productive (and they have real problems with all their modul stuff and such) However up to now I didn`t get this far with all those other programming languages, Hollywood otoh gives real fast results.

So I wonder if it` s even possible to make some special optimized routines for Hollywood which get out everything from those little old gems? I am afraid the answer is no here, however, at least I did ask ;)
Well, the answer is no :-) To get performance out of classic Amigas you have to access the hardware directly and disable multitasking. Hollywood is meant for use in a multitasking environment and does not do ANY direct hardware calls. If you want to do a game for AGA hardware, use BlitzBasic2.
Locked