-
- MightyBear
Control Template Triggers within a Control Template
Hello again Noesis Forums!
I have a control template for a inventory box/slot, with a trigger to increase the size of the icon when IsMouseOver
Now, I have a slight Variation of this slot, used as the template for a ListBoxItem with arrows either side to control the quantity of the item.
When hovering of the slot, the trigger works as intended but, when I hover on the arrows of the Variation, the trigger isn't active.
Is there a way to piggy back the original trigger, icon size increase, through this new variation when IsMouseOver arrows?
I have a control template for a inventory box/slot, with a trigger to increase the size of the icon when IsMouseOver
Now, I have a slight Variation of this slot, used as the template for a ListBoxItem with arrows either side to control the quantity of the item.
When hovering of the slot, the trigger works as intended but, when I hover on the arrows of the Variation, the trigger isn't active.
Is there a way to piggy back the original trigger, icon size increase, through this new variation when IsMouseOver arrows?
- Attachments
-
- Screenshot 2025-05-29 165443.png (21.3 KiB) Viewed 16639 times
Re: Control Template Triggers within a Control Template
Hi Ken! Dorian here!
Just to ensure I'm understanding the situation you're in, and the result you're after:
And then am I correct in understanding that when you mention:
(In the below, what is demonstrated on the Right)
Just to ensure I'm understanding the situation you're in, and the result you're after:
So looking at below, can you confirm that this is what is demonstrated on the Left?I have a control template for a inventory box/slot, with a trigger to increase the size of the icon when IsMouseOver --- When hovering of the slot, the trigger works as intended but, when I hover on the arrows of the Variation, the trigger isn't active.
And then am I correct in understanding that when you mention:
That your intention is to have the icon scale up when hovering over the Increase/Decrease Quantity Buttons too?when I hover on the arrows of the Variation, the trigger isn't active.
(In the below, what is demonstrated on the Right)
-
- MightyBear
Re: Control Template Triggers within a Control Template
Yes Exactly this!
Thank you so much for the work and gif!
Thank you so much for the work and gif!
Re: Control Template Triggers within a Control Template
Fantastic!
Attached, you'll find this file that you can use to inspect how this was achieved, but I'll also give you a little overview of a couple particular points in writing:
First of all, instead of Triggers, since we are inside of a Template, it means we get to use Setters if we want to.
The big advantage of going the Setters route in this case, is that for the Icon Hover effect you wanted to achieve, we are going to want to use a RenderTransform (Scales up without impacting Layout)
It's worth noting that RenderTransform is available in a Trigger, but it expects a 'Matrix' syntax for the value which is a bit more complicated than simply adjusting the RenderTransform values in the Properties with a Setter selected, in a way not too dissimilar to any Property adjustment keyed to any Timeline.
Inside of the ListBoxItemTemplate, you'll see that in the Interactivity/Setters Tab, there is a IsMouseOver Setter that the scaling of the icon takes place in. This is where the magic happens. If you expand the Setter, you can see here that if any part of this Template is moused over, the Element named 'Icon' will RenderTransform by a scale of 1.2 on the X and Y axis.
Now the second other little thing that I want to touch on, is that still inside of the ListBoxItemTemplate, you'll notice that there is an Element called "HitBox" that is set to have a SolidColor Fill, but at 0% opacity. The purpose of putting that in there, is to simply make it so that there is a full zone for the mouse to interact with onHover. If the HitBox weren't there, taking up the entire space, what would happen, is that you'd mouse over the Increase/Decrease Button, the icon would grow, and then in the dead-space between the Button and the Icon, the Icon would shrink then grow again as you entered over the icon...which is a bit ugly visually, so its just to combat that. (whilst also giving each ListBoxItem a consistent Hitbox between eachother regardless of differences in icon profiles/shapes.)
With all that said; Project attached! Take a look, and let us know if you have any other questions!
Attached, you'll find this file that you can use to inspect how this was achieved, but I'll also give you a little overview of a couple particular points in writing:
First of all, instead of Triggers, since we are inside of a Template, it means we get to use Setters if we want to.
The big advantage of going the Setters route in this case, is that for the Icon Hover effect you wanted to achieve, we are going to want to use a RenderTransform (Scales up without impacting Layout)
It's worth noting that RenderTransform is available in a Trigger, but it expects a 'Matrix' syntax for the value which is a bit more complicated than simply adjusting the RenderTransform values in the Properties with a Setter selected, in a way not too dissimilar to any Property adjustment keyed to any Timeline.
Inside of the ListBoxItemTemplate, you'll see that in the Interactivity/Setters Tab, there is a IsMouseOver Setter that the scaling of the icon takes place in. This is where the magic happens. If you expand the Setter, you can see here that if any part of this Template is moused over, the Element named 'Icon' will RenderTransform by a scale of 1.2 on the X and Y axis.
Now the second other little thing that I want to touch on, is that still inside of the ListBoxItemTemplate, you'll notice that there is an Element called "HitBox" that is set to have a SolidColor Fill, but at 0% opacity. The purpose of putting that in there, is to simply make it so that there is a full zone for the mouse to interact with onHover. If the HitBox weren't there, taking up the entire space, what would happen, is that you'd mouse over the Increase/Decrease Button, the icon would grow, and then in the dead-space between the Button and the Icon, the Icon would shrink then grow again as you entered over the icon...which is a bit ugly visually, so its just to combat that. (whilst also giving each ListBoxItem a consistent Hitbox between eachother regardless of differences in icon profiles/shapes.)
With all that said; Project attached! Take a look, and let us know if you have any other questions!
Who is online
Users browsing this forum: No registered users and 1 guest