Page 1 of 1

Bitmap Button ?

PostPosted: Wed Nov 28, 2018 8:22 pm
by az-terisk
Good evening everyone ! :D

For a project I would like to create a bitmap based button that responds to three states :

1. Normal;
2. Mouse Over;
3. Pressed.

I tried to tinker with the "Button" prefab by inserting a single "Bitmap" and removing the "Background" and "Label" part of the Ruby code. But apart from that, i'm stuck.

Indices or tracks to follow ?

Thanks in advance (and sorry for my bad English, I'm French).

Re: Bitmap Button ?

PostPosted: Fri Nov 30, 2018 8:39 pm
by tiffy
az-terisk wrote:Good evening everyone ! :D

For a project I would like to create a bitmap based button that responds to three states :

1. Normal;
2. Mouse Over;
3. Pressed.

I tried to tinker with the "Button" prefab by inserting a single "Bitmap" and removing the "Background" and "Label" part of the Ruby code. But apart from that, i'm stuck.

Indices or tracks to follow ?

Thanks in advance (and sorry for my bad English, I'm French).


Not sure if this is what you require:

Re: Bitmap Button ?

PostPosted: Sat Dec 01, 2018 10:25 am
by Phil Thalasso
Hello Tiffy and thank you for providing this schematic.

Now, if I may dare: Is it possible to set up things in a way
that the button colour changes in its three states?

Example: up=red.jpg
mouse-over=blue.jpg
down=black.jpg

If you found the time to answer that, I'd really appreciate it.
Thank you.

Regards
Phil

Re: Bitmap Button ?

PostPosted: Sat Dec 01, 2018 12:13 pm
by tiffy
Phil Thalasso wrote:Hello Tiffy and thank you for providing this schematic.

Now, if I may dare: Is it possible to set up things in a way
that the button colour changes in its three states?

Example: up=red.jpg
mouse-over=blue.jpg
down=black.jpg

If you found the time to answer that, I'd really appreciate it.
Thank you.

Regards
Phil


Yes, it is possible (and very easy too) to change the schematic in order that the Button Color changes for instance when Mouse-Over is activated as you mentioned "Blue" and "Red" for Mouse-Up and "Black" for Mouse-Down. I previously done something similar but I will have to search through my examples when I have time and upload it (unless someone else is quicker than me and would be so kind to upload an example here) ...as I am currently working on something else. Do you want to use Bitmaps for the Colors?

Re: Bitmap Button ?

PostPosted: Sat Dec 01, 2018 12:53 pm
by Phil Thalasso
Thank you Tiffy for the quick response.
"Do you want to use Bitmaps for the Colors?"
Yes, very much so. I like things to look
appealing (I know ... :-)).

Regards
Phil

Re: Bitmap Button ?

PostPosted: Sat Dec 01, 2018 2:11 pm
by ChrisHooker
Hi Phil and az-terisk,

To get the bitmap to change while hovering, you just need to route the hover status to the selector for the bitmap.
Since status is On/Off, you must convert the On State to an Int (either by forcing a connection to a Float-based prim (CTRL+SHIFT while connecting), or by using a "Select" prim that takes one of 2 inputs based on a Bool status), and then make that Int value (when hovered) high enough that when added to the Bitmap Selector index, it changes to a new bitmap to indicate hovering. More complicated to explain than to do.

Attached is a schematic.
Bitmap Button with Hover.fsm
(18.31 KiB) Downloaded 911 times


Since when hovering over the button, all it shows is the hover bitmap, you can't tell when clicking what state you're changing it to, you can also add a multiplier (by zero) to effectively turn off the hover-state when a click trigger is sent. A delayed trigger will reset back to enabling the hover state bitmap.

Attached is a 2nd schematic to illustrate.


I've modded Tiffy's schematic for these - please note that these are not set up for preset handling nor automation.

Re: Bitmap Button ?

PostPosted: Sat Dec 01, 2018 3:35 pm
by tiffy
Thank you, Chris, well done...I like it.

Hope it is what the other two gentlemen require.

Re: Bitmap Button ?

PostPosted: Sat Dec 01, 2018 5:21 pm
by Phil Thalasso
Wonderful!
Thank you Chris and thank you bunches. During my last vacation I was trying to get at what you presented in minutes - obviously to no avail.
I have to frankly admit that I would not have been capable of thinking-up anything alike myself.
Great learning experience!!

Regards
Phil

Re: Bitmap Button ?

PostPosted: Mon Dec 03, 2018 3:13 pm
by wlangfor@uoguelph.ca
Thanks, I find these ideas useful. It's funny how they're simple to do in theory but the other day I ruined a schematic trying to add mouseover's lol.

Re: Bitmap Button ?

PostPosted: Tue Dec 04, 2018 8:56 pm
by az-terisk
Good evening,

First, sorry for the late response. A big thank you to you, that's exactly what I was looking for ! :o

I'm going to study this schematic.

Good evening ! :D