Bitmap Button ?

Post any examples or modules that you want to share here
Post Reply
az-terisk
Posts: 29
Joined: Sun Dec 25, 2016 1:00 pm

Bitmap Button ?

Post 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).
User avatar
tiffy
Posts: 400
Joined: Wed May 08, 2013 12:14 pm

Re: Bitmap Button ?

Post 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:
Attachments
Bitmap Button (Dual).fsm
(15.24 KiB) Downloaded 1029 times
User avatar
Phil Thalasso
Posts: 150
Joined: Tue Jun 27, 2017 12:42 pm
Location: Munich, Germany

Re: Bitmap Button ?

Post 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
User avatar
tiffy
Posts: 400
Joined: Wed May 08, 2013 12:14 pm

Re: Bitmap Button ?

Post 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?
User avatar
Phil Thalasso
Posts: 150
Joined: Tue Jun 27, 2017 12:42 pm
Location: Munich, Germany

Re: Bitmap Button ?

Post 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
ChrisHooker
Posts: 55
Joined: Tue Jul 13, 2010 10:02 pm

Re: Bitmap Button ?

Post 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 1023 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.
Bitmap Button with Hover and switching indication.fsm
(18.67 KiB) Downloaded 1027 times


I've modded Tiffy's schematic for these - please note that these are not set up for preset handling nor automation.
User avatar
tiffy
Posts: 400
Joined: Wed May 08, 2013 12:14 pm

Re: Bitmap Button ?

Post by tiffy »

Thank you, Chris, well done...I like it.

Hope it is what the other two gentlemen require.
User avatar
Phil Thalasso
Posts: 150
Joined: Tue Jun 27, 2017 12:42 pm
Location: Munich, Germany

Re: Bitmap Button ?

Post 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
User avatar
wlangfor@uoguelph.ca
Posts: 912
Joined: Tue Apr 03, 2018 5:50 pm
Location: North Bay, Ontario, Canada
Contact:

Re: Bitmap Button ?

Post 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.
My youtube channel: DSPplug
My Websites: www.dspplug.com KVRaudio flowstone products
az-terisk
Posts: 29
Joined: Sun Dec 25, 2016 1:00 pm

Re: Bitmap Button ?

Post 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
Post Reply