advanced skinning
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
advanced skinning
is there anyway to have a true custom shaped button. every time i skin a button it seems to keep the rectangle or square form (the invisible area still able to be clicked)? i want the button to be the shape of my object. if i can't do this with a button is there any other objects that can have true custom shapes from an image?
Re: advanced skinning
Hi kcwvc52,
you could create a graphic with the freehand tool, freehand polygon tool or any other graphic and set its opaquen to true. turn border on or off. Then
the code for the "button" goes into the script of the graphic.
Is this the kind of effect you are looking for? Or else please explain object it is you want to turn into a button.
Kind regards
Bernd
you could create a graphic with the freehand tool, freehand polygon tool or any other graphic and set its opaquen to true. turn border on or off. Then
Code: Select all
set the backgroundpattern of grc 1 to the id of image 1
Is this the kind of effect you are looking for? Or else please explain object it is you want to turn into a button.
Kind regards
Bernd
Re: advanced skinning
Hi kcwvc52, Salut Bernd
I've made a little stack with what Bernd has explaned
I try have the same behavior of the btn (set the hilite to false when the mouseloc is not within the grc)
but the mouseup don't work well. Sometimes it work sometimes not (conflict with my mousedown script?)
BUT i'm sur Bernd have a solution
Best regards
Jean-Marc
I've made a little stack with what Bernd has explaned
I try have the same behavior of the btn (set the hilite to false when the mouseloc is not within the grc)
but the mouseup don't work well. Sometimes it work sometimes not (conflict with my mousedown script?)
BUT i'm sur Bernd have a solution

Best regards
Jean-Marc
- Attachments
-
- skinBtn.rev.zip
- (6.01 KiB) Downloaded 452 times
https://alternatic.ch
Re: advanced skinning
Salut Jean-Marc,
nice stack.
To mimick the behaviour of a 'true' button I had to use a mouseMove handler and test for within. Found out that there is a difference between:
and
only the second one works for a non-rectangular clicking area, like in the irregularly shaped graphic you used.
And I did "close" the points of the graphic by putting the first line of the points behind the list of points. Otherwise the trigger area is not exactly within the shape of the graphic.
I attach a modified version of your stack, I think it does behave more like a regular button now: if the mouse is down and one moves the mouse outside of the trigger area the backgroundpattern changes to normal and back to clicked state if the mouse moves back into the trigger area.
Kind regards
Bernd
nice stack.
To mimick the behaviour of a 'true' button I had to use a mouseMove handler and test for within. Found out that there is a difference between:
Code: Select all
point is within rect of me
Code: Select all
within(me, point)
And I did "close" the points of the graphic by putting the first line of the points behind the list of points. Otherwise the trigger area is not exactly within the shape of the graphic.
I attach a modified version of your stack, I think it does behave more like a regular button now: if the mouse is down and one moves the mouse outside of the trigger area the backgroundpattern changes to normal and back to clicked state if the mouse moves back into the trigger area.
Kind regards
Bernd
Re: advanced skinning
Guten Morgen Bernd,
Thanks again
It work well
Kind regards
Jean-Marc
Thanks again
It work well
Kind regards
Jean-Marc
https://alternatic.ch