Transparency
  • Butterfly
    Butterfly
    Posts: 62 from 2004/9/8
    From: France
    I try to do a gui on MUI with transparency like "anr". But I have a problem...

    If I take "transparency.c" as an example, I don't have
    an equivalence to WA_TransparentRegionHook for MUI and I don't known how to do that...

    Perhaps, somebody may be help me ??

    (Sorry for my bad english..)
    PegasosII G4 512Mo 80Go ATI RADEON 9200SE....
    Yeah! The best it's MorphOS :)
  • »16.09.06 - 17:08
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 416 from 2003/2/24
    From: Berlin
    Hi,

    I did that in my TopCPU app, I just sent you a mail with some code examples!

    Bye!
  • »16.09.06 - 20:50
    Profile Visit Website
  • Butterfly
    Butterfly
    Posts: 62 from 2004/9/8
    From: France
    thanks for your email...
    I'm going to study all that :))
    PegasosII G4 512Mo 80Go ATI RADEON 9200SE....
    Yeah! The best it's MorphOS :)
  • »16.09.06 - 21:13
    Profile Visit Website
  • Butterfly
    Butterfly
    Posts: 62 from 2004/9/8
    From: France
    Here is result...

    It's just a test for a gui of mplayer...

    [ Edited by rusback on 2006/9/17 17:45 ]
    PegasosII G4 512Mo 80Go ATI RADEON 9200SE....
    Yeah! The best it's MorphOS :)
  • »17.09.06 - 08:42
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    warface
    Posts: 653 from 2003/2/24
    From: Hungary
    Lovely... :-) (...resemblance to winamp :-D )
  • »18.09.06 - 17:08
    Profile Visit Website
  • ASiegel
    Posts: 1376 from 2003/2/15
    From: Central Europe
    MPlayer GUI? Finally! More power to you.

    Maybe you would like to take a look at the skinning system of the unreleased new FroggerNG version for inspiration? I have a couple of finished skins which could be reused in that case.
  • »18.09.06 - 18:33
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    magnetic
    Posts: 2129 from 2003/3/1
    From: Los Angeles
    Jobbo

    great idea. those frogger skins looked really cool and fit in with mos theme

    magnetic
    Pegasos 2 Rev 2B3 w/ Freescale 7447 "G4" @ 1ghz / 1gb Nanya Ram
    Quad Boot: MorphOS 2.7 | Amiga OS4.1 U4 | Ubuntu PPC GNU/Linux | OS X 10.4
  • »18.09.06 - 19:22
    Profile Visit Website
  • Butterfly
    Butterfly
    Posts: 62 from 2004/9/8
    From: France
    @warface: yes it's an gui of winamp modified a little...

    @Jobbo: why not... send me please for a test...

    [ Edited by rusback on 2006/9/18 20:40 ]
    PegasosII G4 512Mo 80Go ATI RADEON 9200SE....
    Yeah! The best it's MorphOS :)
  • »18.09.06 - 19:34
    Profile Visit Website
  • ASiegel
    Posts: 1376 from 2003/2/15
    From: Central Europe
    Quote:

    @Jobbo: why not... send me please for a test...


    Unless your spam filter ate it, you should have an email by now :-)
  • »20.09.06 - 21:23
    Profile
  • Butterfly
    Butterfly
    Posts: 62 from 2004/9/8
    From: France
    I'd like to set up a drag gadget over some parts of my mui window (background parts). What's the best way to implement it ??
    PegasosII G4 512Mo 80Go ATI RADEON 9200SE....
    Yeah! The best it's MorphOS :)
  • »26.09.06 - 21:20
    Profile Visit Website
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Gelb
    Posts: 148 from 2003/3/4
    From: #amigazeux
    > I'd like to set up a drag gadget over some parts of my
    > mui window (background parts). What's the best way to
    > implement it ??

    Subclass MUIC_Rectangle and do something like

    OBJECT classdata
    ...
    sysgadget:PTR TO LONG
    ...
    ENDOBJECT

    and in your MUIM_Show method you do:

    DEF w:PTR TO window

    IF muiRenderInfo(obj)
    IF w:=_window(obj)
    data.sysgadget:=NewObjectA(0,BUTTONGCLASS,[
    GA_LEFT, _left(obj),
    GA_TOP, _top(obj),
    GA_WIDTH, _width(obj),
    GA_HEIGHT, _height(obj),
    GA_SYSGTYPE, GTYP_WDRAGGING,
    GA_IMMEDIATE, TRUE,
    TAG_DONE])

    IF data.sysgadget THEN AddGadget(w,data.sysgadget,-1) [edit: forgot this vital line :/]
    ENDIF
    ENDIF

    matching the above in your MUIM_Hide with:

    DEF w:PTR TO window

    IF muiRenderInfo(obj)
    IF w:=_window(obj)
    IF data.sysgadget
    RemoveGadget(w, data.sysgadget)
    DisposeObject(data.sysgadget)
    ENDIF
    data.sysgadget:=NIL
    ENDIF
    ENDIF

    If you don't want object dimensions as it will just be some useless HVSpace, use MUIA_FixWidth/Height of 1 and use whatever you like for l/t/w/h in MUIM_Show.

    Note that there are millions of other ways to do it, but I guess the important part here is adding a system gadget to your MUI app.

    The above won't make up for the drag gadget being in the background, so all other objects it overlaps won't receive input anymore.

    If there's no other obvious way to do it (I have found none), you need to traverse through object list of root group object and substract object regions from your intended drag area and add a drag gadget for each remaining region after traversing. At least that's how its done in newer ANR versions.

    Note2: The nice formatting got lost in preview of this post, so I guess the posted post will also have no formatting.
  • »26.09.06 - 21:43
    Profile Visit Website
  • Butterfly
    Butterfly
    Posts: 62 from 2004/9/8
    From: France
    Gelb: thanks you very much... for your help
    PegasosII G4 512Mo 80Go ATI RADEON 9200SE....
    Yeah! The best it's MorphOS :)
  • »27.09.06 - 03:37
    Profile Visit Website
  • Butterfly
    Butterfly
    Posts: 62 from 2004/9/8
    From: France
    @Jobbo: I have not yet receive your email... Did you forget me ??
    PegasosII G4 512Mo 80Go ATI RADEON 9200SE....
    Yeah! The best it's MorphOS :)
  • »01.10.06 - 11:40
    Profile Visit Website
  • ASiegel
    Posts: 1376 from 2003/2/15
    From: Central Europe
    Quote:

    @Jobbo: I have not yet receive your email... Did you forget me ??


    Absolutely not. The email was sent to your wanadoo email address on September 20th, at 9.16 pm (CET). If this email address does not work for you anymore, please send me your current one via PM. Thank you.
  • »01.10.06 - 12:02
    Profile
  • Butterfly
    Butterfly
    Posts: 62 from 2004/9/8
    From: France
    @jobbo: try once again please... my email address works always.
    PegasosII G4 512Mo 80Go ATI RADEON 9200SE....
    Yeah! The best it's MorphOS :)
  • »01.10.06 - 12:20
    Profile Visit Website
  • ASiegel
    Posts: 1376 from 2003/2/15
    From: Central Europe
    Quote:

    @jobbo: try once again please... my email address works always.


    Apparently, it does not :) Anyway, email was just resent.
  • »01.10.06 - 14:27
    Profile
  • Butterfly
    Butterfly
    Posts: 62 from 2004/9/8
    From: France
    @Jobbo: ok... your email is arrived... cool, isn't it ???
    PegasosII G4 512Mo 80Go ATI RADEON 9200SE....
    Yeah! The best it's MorphOS :)
  • »01.10.06 - 16:54
    Profile Visit Website
  • ASiegel
    Posts: 1376 from 2003/2/15
    From: Central Europe
    Quote:

    @Jobbo: ok... your email is arrived... cool, isn't it ???


    Sure. It will be even cooler if you can actually make use of the sent skins 8-)
  • »02.10.06 - 00:24
    Profile
  • Butterfly
    Butterfly
    Posts: 62 from 2004/9/8
    From: France
    just for fun, here a new screenshot of my gui for mplayer...
    PegasosII G4 512Mo 80Go ATI RADEON 9200SE....
    Yeah! The best it's MorphOS :)
  • »08.10.06 - 12:48
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    warface
    Posts: 653 from 2003/2/24
    From: Hungary
    cu... interesting :-D
  • »08.10.06 - 18:31
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    r-tea
    Posts: 306 from 2005/3/27
    From: Poland, Zdzies...
    @ Gelb

    I'd love to se some kind of ready/easy to use dragarea object eg. MUIC_DragArea or an attribute of RectangleObject eg. MUIA_DragArea in future versions of MUI.
    I'm sure rusback would be pleased too. :-)
    Have to send such a request to Stunzi.
    Mac mini G4@1,5GHz silent upgrade + Xerox Phaser 3140 + EPSON Perfection 1240U
    Commodore C64C + 2 x 1541II + Datasette + SD-Box

    I miss draggable screens... and do you? I know I'm in a minority unfortunately.
  • »12.10.06 - 09:28
    Profile
  • Butterfly
    Butterfly
    Posts: 62 from 2004/9/8
    From: France
    @gelb:

    in ANR, GUI is composed de "main.iff" (format .png 24 bits) with a pink background, but on Ambient, ANR don't display the pink color but rather the background of screen's Ambient instead ...
    Is there one method to do this ???
    PegasosII G4 512Mo 80Go ATI RADEON 9200SE....
    Yeah! The best it's MorphOS :)
  • »16.10.06 - 19:05
    Profile Visit Website
  • MorphOS Developer
    Henes
    Posts: 507 from 2003/6/14
    Yes, see Gelb's message.
  • »17.10.06 - 00:09
    Profile Visit Website
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Gelb
    Posts: 148 from 2003/3/4
    From: #amigazeux
    @rusback

    > In ANR, GUI is composed de "main.iff" (format .png 24 bits) with a pink
    > background, but on Ambient, ANR don't display the pink color but rather
    > the background of screen's Ambient instead ...

    > Is there one method to do this ???

    Yes, there is !!! :roll: :hammer:

    What you need to do is:

    a) Build a region (using region functions) out of the bits and pieces of your image that you want to have fully transparent.

    b) Use TransparencyControl(window, TRANSPCONTROLMETHOD_INSTALLREGION, [TRANSPCONTROL_REGION, mytransparencyregion, TAG_DONE]) (intuition.library) to set this region as the transparency region of your _window(obj) in any MUIM_Show of your choice and match it with TransparencyControl(window, TRANSPCONTROLMETHOD_INSTALLREGION, [TRANSPCONTROL_REGION, NIL, TAG_DONE]) in MUIM_Hide.

    So, in ANR's case, it collects all the pink pixels of the image into a region (NewRegion()/OrRectRegion()) in MUIM_Setup, installs this region in MUIM_Show, removes it again in MUIM_Hide and finally frees it via DisposeRegion() in MUIM_Cleanup. This all is done in its root group class.
  • »17.10.06 - 17:57
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    magnetic
    Posts: 2129 from 2003/3/1
    From: Los Angeles
    Glad you guys are working on this. Very cool..

    magnetic
    Pegasos 2 Rev 2B3 w/ Freescale 7447 "G4" @ 1ghz / 1gb Nanya Ram
    Quad Boot: MorphOS 2.7 | Amiga OS4.1 U4 | Ubuntu PPC GNU/Linux | OS X 10.4
  • »18.10.06 - 17:46
    Profile Visit Website