#✅ | Animated custom sliding hotbar selection image element?
1 messages · Page 1 of 1 (latest)
Hi! 👋 Please first click the button below to start this support ticket.
⚠️ It is not possible for anybody to send messages in this ticket before it has been started, so you need to click the button for others to be able to help/answer you.
If you mean the currently selected hotbar slot (not mouse hover), then yes, do it with Advanced Positioning and the active_hotbar_slot placeholder 👀
Simple setup:
- Put your Image element in the HUD layout.
- Right-click it → Advanced Positioning.
- Set the X position with a calc placeholder like this:
{"placeholder":"calc","values":{"decimal":"false","expression":"BASE_X + ({"placeholder":"active_hotbar_slot"} * SLOT_WIDTH)"}}
Replace:
BASE_X= X position of slot 0SLOT_WIDTH= distance between hotbar slots
Example if slot 0 starts at 100 and each slot is 20px apart:
{"placeholder":"calc","values":{"decimal":"false","expression":"100 + ({"placeholder":"active_hotbar_slot"} * 20)"}}
Important:
active_hotbar_slotgoes from0to8- Keep the Y position fixed
- If your image should be centered on the slot, subtract half of the image width from the X value
About “hovered”
- The docs I have do not show a built-in “hovered hotbar slot” value
- So for the vanilla hotbar, this is normally done with the selected slot, not hover
If you want, I can help you calculate the exact BASE_X / SLOT_WIDTH formula for your specific hotbar size 🤝
i have an 8 slot custom hotbar element thats 182x22 at x position 229 how do i translate that so the selector aligns with every slot
Yep, if you mean the currently selected hotbar slot, use active_hotbar_slot and a slot width based on your bar size 🤝
Your bar is:
- X start:
229 - Width:
182 - Slots:
8
So each slot is:
182 / 8 = 22.75 px
Use this for the selector’s X position in Advanced Positioning:
{"placeholder":"calc","values":{"decimal":"false","expression":"229 + ({"placeholder":"active_hotbar_slot"} * 22.75)"}}
If the selector image should be centered on the slot, then add half a slot and subtract half the selector width:
{"placeholder":"calc","values":{"decimal":"false","expression":"229 + ({"placeholder":"active_hotbar_slot"} * 22.75) + 11.375 - (SELECTOR_WIDTH / 2)"}}
A couple of notes:
active_hotbar_slotis 0 to 8 in vanilla- If your hotbar truly has only 8 slots, you may need a small manual tweak because
182 / 8is not a whole number - If it’s slightly off, nudge the base
229by 1–2 pixels until it lines up perfectly 👀
If you want, I can also give you the exact X positions for all 8 slots as a ready-made list.
will this be monitor resolution adaptive
Not if you hardcode 229 and 182, that will only line up for the same GUI scale / layout size you tested on 🤔
For it to be resolution-adaptive, base the selector position on the hotbar element itself, not fixed screen pixels.
A better setup is:
{"placeholder":"calc","values":{"decimal":"false","expression":"{"placeholder":"elementposx","values":{"id":"custom_hotbar"}} + ({"placeholder":"active_hotbar_slot"} * ({"placeholder":"elementwidth","values":{"id":"custom_hotbar"}} / 8))"}}
If you want the selector centered on each slot, add half a slot and subtract half the selector width:
{"placeholder":"calc","values":{"decimal":"false","expression":"{"placeholder":"elementposx","values":{"id":"custom_hotbar"}} + ({"placeholder":"active_hotbar_slot"} * ({"placeholder":"elementwidth","values":{"id":"custom_hotbar"}} / 8)) + ({"placeholder":"elementwidth","values":{"id":"custom_hotbar"}} / 16) - (SELECTOR_WIDTH / 2)"}}
A few important notes:
- This assumes your hotbar element has the ID
custom_hotbar active_hotbar_slotis the selected slot index8is the number of slots in your custom hotbar- If the hotbar itself is already positioned/resized responsively, the selector will follow that too
If you want, I can turn this into the exact final placeholder string for your selector width.
also mb it does have 9 slots,
Yep, then it should be divided by 9, not 8 🤓
If you want it to stay adaptive, use the hotbar element’s position and width:
{"placeholder":"calc","values":{"decimal":"false","expression":"{"placeholder":"elementposx","values":{"id":"custom_hotbar"}} + ({"placeholder":"active_hotbar_slot"} * ({"placeholder":"elementwidth","values":{"id":"custom_hotbar"}} / 9))"}}
If you want the selector to sit centered on each slot, use:
{"placeholder":"calc","values":{"decimal":"false","expression":"{"placeholder":"elementposx","values":{"id":"custom_hotbar"}} + ({"placeholder":"active_hotbar_slot"} * ({"placeholder":"elementwidth","values":{"id":"custom_hotbar"}} / 9)) + ({"placeholder":"elementwidth","values":{"id":"custom_hotbar"}} / 18) - (YOUR_SELECTOR_WIDTH / 2)"}}
For your 182 px bar:
- slot width =
182 / 9 = 20.222...
So if needed, you can also hardcode it like:
{"placeholder":"calc","values":{"decimal":"false","expression":"229 + ({"placeholder":"active_hotbar_slot"} * 20.222222)"}}
If you want, I can turn this into the exact final string for your selector size too 👀
the selector is 22 width but it isnt responding to either of these
Got it, if it’s not moving at all, the most likely problem is one of these 👀
-
custom_hotbarwas not the real element ID- You need to use the hotbar element’s actual identifier from Right-click element → Copy Element Identifier.
-
You mean hovered slot, but FancyMenu only gives us the selected slot
- The docs I have only show
active_hotbar_slot, which is the currently selected hotbar slot. - I don’t have a doc for a true “hovered hotbar slot” placeholder.
- The docs I have only show
-
The position field may not be updating live in the way you expect
- The safest way is to push the value into a variable with a Ticker, then use that variable for the selector’s X position.
For your bar, the slot step is:
182 / 9 = 20.222222...
If you want the selector centered on each slot, try this with the real hotbar element ID:
{"placeholder":"calc","values":{"decimal":"false","expression":"{"placeholder":"elementposx","values":{"id":"YOUR_HOTBAR_ID"}} + ({"placeholder":"active_hotbar_slot"} * ({"placeholder":"elementwidth","values":{"id":"YOUR_HOTBAR_ID"}} / 9)) - 1"}}
Because your selector is 22 px wide, that - 1 is the small centering correction.
If that still doesn’t move, do this instead:
- Create a Ticker
- Update a variable like
selector_x - Set the selector’s X position to:
{"placeholder":"getvariable","values":{"name":"selector_x"}}
If you want, send me:
- the hotbar element ID
- whether you want selected slot or true mouse hover
- and your
/logs/latest.logright after testing
Then I can pinpoint why it isn’t reacting 🛑
{"placeholder":"calc","values":{"decimal":"false","expression":"{"placeholder":"elementposx","values":{"id":"YOUR_HOTBAR_ID"}} + ({"placeholder":"active_hotbar_slot"} * ({"placeholder":"elementwidth","values":{"id":"YOUR_HOTBAR_ID"}} / 9)) - 1"}}
nvm this started working but the position is slightly off on the last 3 slots on the left and right
Yep, that drift is because 182 / 9 is not the real slot spacing here 😅
For a 9-slot hotbar, the selector step is usually 20 px per slot, and the extra 2 px are just padding on the bar.
Use this:
{"placeholder":"calc","values":{"decimal":"false","expression":"229 + ({"placeholder":"active_hotbar_slot"} * 20)"}}
If slot 0 is off by 1 pixel, just nudge the base 229 to 228 or 230.
So the rule of thumb is:
- step = 20
- base X = your bar’s left edge, adjusted by 1 px if needed
If you want, I can help you make the selector snap perfectly by giving you the exact X for all 9 slots 📐
okay rewrite the whole thing with that change
Yep, here’s the rewritten version with the 20 px slot step 📐
Use this for the selector’s X position:
{"placeholder":"calc","values":{"decimal":"false","expression":"{"placeholder":"elementposx","values":{"id":"YOUR_HOTBAR_ID"}} + ({"placeholder":"active_hotbar_slot"} * 20) - 1"}}
What this does:
elementposx= left edge of your hotbaractive_hotbar_slot= selected slot index20= distance between slots- 1= centers your 22 px selector better
If it’s still a tiny bit off, only tweak the last number:
- 2- 10
That last pixel is usually just manual fine-tuning 😅
neat it works now, i just removed the last number -
although curious can we make it so when scrolling it's actually sliding animated
Yep, but not directly from the raw X placeholder alone 😄
FancyMenu doesn’t seem to have a built-in “smoothly tween this position” toggle for placeholder-driven movement, so the best workaround is:
- Keep your current working X formula as the target
- Animate a separate X variable toward that target
- Use that animated variable as the selector’s X position
Simple setup
1) Make the selector use a variable for X
Set the selector image’s X position to:
{"placeholder":"getvariable","values":{"name":"selector_x"}}
2) Store the real slot position in another variable
Use a Ticker to update selector_target_x with your working formula, for example:
selector_target_x:{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"elementposx","values":{"id":"YOUR_HOTBAR_ID"}} + ({"placeholder":"active_hotbar_slot"} * 20)"}}
3) Smoothly move selector_x toward it
In the same Ticker, set selector_x to:
selector_x:{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"selector_x"}} + (({"placeholder":"getvariable","values":{"name":"selector_target_x"}} - {"placeholder":"getvariable","values":{"name":"selector_x"}}) * 0.35)"}}
What the 0.35 does
- Higher value = snappier
- Lower value = smoother/slower
Try:
0.25for soft glide0.35for a nice responsive slide0.5for pretty snappy movement
Important
- Use
decimal":"true"for the smoothing variable - You may want to initialize
selector_xto the current target once when the screen opens, so it doesn’t start from0
If you want, I can write the full exact Ticker action script for this so you can paste it in directly 👌
okay back to the selector can we make the y position to match the hotbar's
Yes 👍
If you want the selector to follow the hotbar’s vertical position, set its Y position to the hotbar element’s Y:
{"placeholder":"elementposy","values":{"id":"YOUR_HOTBAR_ID"}}
If your selector is also 22 px tall like the hotbar, that should line up directly.
If it’s still a pixel or two off, just add a tiny offset, for example:
{"placeholder":"calc","values":{"decimal":"false","expression":"{"placeholder":"elementposy","values":{"id":"YOUR_HOTBAR_ID"}} + 1"}}
So:
- same height → use the hotbar Y directly
- slightly off → add
+ 1or- 1
If you want, I can rewrite both the X and Y formulas together as one clean final setup for you 🤝
can we make it (as well as the hotbar, and slots) work like autohud in that it slides down and hides after a few seconds when not in use
way i see this is set all their loading requirement to be a variable checker
Yes, but not with loading requirements alone 😄
A requirement like hotbar_visible:true is good for show/hide, but it will not create the sliding animation by itself.
Best setup
Use two parts:
1) Visibility control
Set the hotbar, slots, and selector to only show when a variable is true:
- requirement:
Is Variable Value - value:
hotbar_visible:true
2) Slide animation
Use either:
- an Element Animator for the Y movement, or
- a variable-driven Y position that moves smoothly
Important detail
If you put the visibility requirement on the whole hotbar layout, then that layout will unload when hidden.
So the thing that turns hotbar_visible back on must live in:
- a separate always-loaded layout, or
- a scheduler/ticker that is not part of the hidden group
How to make it AutoHUD-like
Use a small controller that:
- sets
hotbar_visibletotruewhen the selected slot changes - remembers the last time that happened
- sets
hotbar_visibletofalseafter a few seconds of no activity
Your slot change trigger can use:
active_hotbar_slot
Recommended result
- hotbar_visible = true → bar slides up in
- hotbar_visible = false → bar slides down out
- selector and slots follow the same system
If you want, I can write you the exact variable + ticker setup for this next 🤝
lesdoit
Yep, let’s do it 😄
Best way: don’t use loading requirements for the slide itself.
Use them only if you want a hard hide/show. For the AutoHUD-style slide, use a moving Y variable instead.
Setup idea
You’ll want:
hotbar_anim_y→ actual Y used by the hotbarhotbar_target_y→ where the hotbar should move tohotbar_timer→ counts down after last slot changelast_hotbar_slot→ remembers the last selected slot
1) Make the hotbar move with a variable
Set the hotbar root element’s Y position to:
{"placeholder":"getvariable","values":{"name":"hotbar_anim_y"}}
Then make your selector and slot elements anchored to the hotbar root so they move with it.
2) Use 2 Y positions
Pick:
VISIBLE_Y= the normal hotbar YHIDDEN_Y= a bit lower, so it slides off-screen
Example:
- visible:
378 - hidden:
406
3) Controller ticker
Put a Ticker in a separate always-loaded layout.
Make it run every 50 ms or so.
Logic
- If
active_hotbar_slotchanged:- set
hotbar_target_ytoVISIBLE_Y - set
hotbar_timerto something like40ticks - update
last_hotbar_slot
- set
- Else:
- count
hotbar_timerdown - when it hits
0, sethotbar_target_ytoHIDDEN_Y
- count
Smooth slide
Also update hotbar_anim_y every tick toward hotbar_target_y with:
{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"hotbar_anim_y"}} + (({"placeholder":"getvariable","values":{"name":"hotbar_target_y"}} - {"placeholder":"getvariable","values":{"name":"hotbar_anim_y"}}) * 0.25)"}}
4) Important
If you want the hotbar to come back when you scroll/change slots, the controller must stay loaded somewhere else, not inside the hotbar layout itself.
What this gives you
- change slot → hotbar slides in
- no slot changes for a few seconds → hotbar slides down and hides
- selector and slots follow the same movement
If you want, I can write the exact Ticker action script in FancyMenu-style step form for you next 🤝
this seems like it might break the current setup, how about we just make the opacity of these elements altogether be dependent on whether the hotbar has been in use for x seconds
Yes, that’s the safer way 👍
It won’t mess with your current positioning setup, because you’re only changing visibility by opacity, not moving anything.
Recommended setup
Use one opacity variable for all hotbar parts, for example:
hotbar_alpha
Set it on:
- the hotbar
- the slot images
- the selector image
Then set each element’s opacity to:
{"placeholder":"getvariable","values":{"name":"hotbar_alpha"}}
How to drive it
Use a Ticker in the same layout that:
- checks whether the hotbar was used recently
- sets
hotbar_alphato1while active - sets
hotbar_alphato0afterxseconds of inactivity
Best trigger
Since the docs don’t show a direct “hotbar scrolled” event, the most reliable way is:
- watch
active_hotbar_slot - store the last slot in a variable like
last_hotbar_slot - when it changes, refresh the timer
If you also want item usage to keep it visible, you can include:
is_player_using_item
Simple behavior
- slot changes → opacity becomes
1 - no use for
xseconds → opacity becomes0
If you want it smoother
You can also make hotbar_alpha slowly fade from 1 to 0 instead of instantly dropping. That’s the cleaner “AutoHUD” feel 😄
If you want, I can write the exact ticker logic for:
- instant hide after delay, or
- smooth fade-out after delay
smooth fade in and out maybe?
Yes, that’s the cleanest way 👍
For a smooth hide/show, I’d use:
- a boolean variable like
hotbar_visible - Loading Requirements on the hotbar, slots, and selector
- FancyMenu’s built-in fading for the elements
Recommended setup
1) Add the requirement
On the hotbar, every slot element, and the selector:
- right-click element
- Loading Requirements
- add Is Variable Value
- set it to:
hotbar_visible:true
2) Enable fading
On those same elements:
- right-click element
- enable the built-in fading feature
- set the fade speed to whatever feels right
That way:
- when
hotbar_visiblebecomestrue→ it fades in - when it becomes
false→ it fades out
3) Drive the variable with a ticker
Put a Ticker in an always-loaded layout, and have it:
- set
hotbar_visible:truewhen the hotbar is used - wait
xseconds after the last use - then set
hotbar_visible:false
A good trigger is:
active_hotbar_slotchanging- optionally also
is_player_using_item
Important
I’d use this method instead of opacity-placeholder tweening, because the docs specifically support fading on load/unload, and it’s much simpler and safer 😄
If you want, I can write the exact ticker logic next, either:
- slot-change only
- or slot-change + item use
slot change only please
Yep 👍
Here’s the slot-change-only version, with smooth fade in/out.
What to use
Use these variables:
hotbar_visible=true/falsehotbar_timeout= number of seconds leftlast_hotbar_slot= the last selected slot
On the hotbar / slots / selector
Add this loading requirement to all of them:
- Is Variable Value
hotbar_visible:true
Then enable fading on those elements so they fade in/out when the variable changes.
Controller Ticker
Put this in a separate always-loaded layout so it keeps running even while the hotbar is hidden.
Set it to tick every 1000 ms.
Logic
-
If the selected slot changed:
- set
hotbar_visible:true - set
hotbar_timeout:3← change this to however many seconds you want - set
last_hotbar_slotto the currentactive_hotbar_slot
- set
-
Else if
hotbar_timeout > 0:- subtract
1
- subtract
-
Else:
- set
hotbar_visible:false
- set
Useful expressions
Detect slot change
Use this as the comparison value:
{"placeholder":"calc","values":{"decimal":"false","expression":"abs({"placeholder":"active_hotbar_slot"} - {"placeholder":"getvariable","values":{"name":"last_hotbar_slot"}})"}}
If that result is > 0, the slot changed.
Decrease the timeout
Use:
{"placeholder":"calc","values":{"decimal":"false","expression":"{"placeholder":"getvariable","values":{"name":"hotbar_timeout"}} - 1"}}
Important
Initialize last_hotbar_slot once at the start, or the hotbar may briefly show on first load. If you want, I can write the exact FancyMenu action script block-by-block next 😄
a little confusing, try explaining that again to me
Of course, here’s the simple version 😄
The idea
You make the hotbar parts depend on one variable:
hotbar_visible
If that variable is true:
- hotbar
- slots
- selector
...are shown, and they fade in.
If it becomes false:
- they fade out and hide.
What you put on the hotbar elements
On each of these elements:
- hotbar
- slot images
- selector
add this loading requirement:
- Is Variable Value
hotbar_visible:true
Then enable the element’s built-in fading option.
What watches for slot changes
Use a Ticker in a layout that stays loaded all the time.
Its job is just:
- look at
active_hotbar_slot - compare it to
last_hotbar_slot
If the slot changed:
- set
hotbar_visibletotrue - reset a timeout like
3seconds - save the new slot number into
last_hotbar_slot
If the slot did not change:
- count the timeout down
- when it reaches
0, sethotbar_visibletofalse
In plain English
So the flow is:
- You scroll to another slot
- The ticker notices the slot changed
- It shows the hotbar again
- It waits a few seconds
- If you do nothing, it hides again with a fade
Important part
The ticker must be in a layout that is always loaded.
If you put it in the same layout that hides, it will stop running when the hotbar disappears, and then it can’t bring itself back 🤭
If you want, I can now turn this into a very simple “do this / then this” setup with the exact variables and values to use.
how do i set that up in the ticker action script
Yep, here’s the exact ticker action script setup, kept simple 😄
First: ticker settings
Set the ticker to run every:
1000 ms
That way the timeout counts in seconds.
Ticker action script
Right-click the ticker → Edit Action Script → build this:
1) IF the hotbar slot changed
Add an IF statement with this requirement:
- Is Number
- Mode:
not-equals - Number:
{"placeholder":"active_hotbar_slot"} - Compare With:
{"placeholder":"getvariable","values":{"name":"last_hotbar_slot"}}
Inside that IF block, add these actions:
Set Variable Value→hotbar_visible:trueSet Variable Value→hotbar_timeout:3Set Variable Value→last_hotbar_slot:{"placeholder":"active_hotbar_slot"}
2) ELSE: count the timeout down
Append an ELSE statement to that IF.
Inside the ELSE, add another IF statement with this requirement:
- Is Number
- Mode:
bigger-than - Number:
{"placeholder":"getvariable","values":{"name":"hotbar_timeout"}} - Compare With:
0
Inside this inner IF, add:
Set Variable Value→hotbar_timeout:{"placeholder":"calc","values":{"decimal":"false","expression":"{"placeholder":"getvariable","values":{"name":"hotbar_timeout"}} - 1"}}
Inside the inner ELSE, add:
Set Variable Value→hotbar_visible:false
So the flow becomes
- slot changes → show hotbar, reset timer to 3
- no slot changes → timer counts down
- timer hits 0 → hide hotbar
Don’t forget
On the hotbar, slots, and selector:
- add loading requirement
hotbar_visible:true - enable fading on those elements
One small note
If last_hotbar_slot is empty at first, the hotbar may briefly show once on load.
If that happens, just set last_hotbar_slot to the current selected slot once manually in Manage Variables.
If you want, I can also write this in a compact “click here, add this, then this” checklist version 🤝
there is no "not equals" condition
You’re right, there is no “not equals” condition in the docs 😅
My bad.
Use this instead
Top-level IF
Add an IF statement with:
- Requirement:
Is Number - Mode:
equals - Number:
{"placeholder":"active_hotbar_slot"} - Compare With:
{"placeholder":"getvariable","values":{"name":"last_hotbar_slot"}}
That means: “if the slot did not change”.
Inside that IF
Add another IF:
- Requirement:
Is Number - Mode:
bigger-than - Number:
{"placeholder":"getvariable","values":{"name":"hotbar_timeout"}} - Compare With:
0
Inside this inner IF
Add:
hotbar_timeout:{"placeholder":"calc","values":{"decimal":"false","expression":"{"placeholder":"getvariable","values":{"name":"hotbar_timeout"}} - 1"}}
Inner ELSE
Add:
hotbar_visible:false
Top-level ELSE
This means the slot changed.
Inside it add:
hotbar_visible:true
hotbar_timeout:3
last_hotbar_slot:{"placeholder":"active_hotbar_slot"}
Result
- same slot as before → countdown runs
- timeout hits 0 → hide hotbar
- different slot → show hotbar and reset timer
Important
Make sure the ticker runs every:
1000 ms
And keep hotbar_visible:true as the loading requirement on:
- hotbar
- slot elements
- selector
with fading enabled on those elements.
If you want, I can turn this into a clean exact tree view of the action script next 🤝
what would the outline of these look like
Sure 🤓 Here’s the outline of the ticker action script:
Ticker (runs every 1000 ms)
├─ IF
│ Requirement:
│ - Is Number
│ - Mode: equals
│ - Number: {"placeholder":"active_hotbar_slot"}
│ - Compare With: {"placeholder":"getvariable","values":{"name":"last_hotbar_slot"}}
│
│ ├─ IF
│ │ Requirement:
│ │ - Is Number
│ │ - Mode: bigger-than
│ │ - Number: {"placeholder":"getvariable","values":{"name":"hotbar_timeout"}}
│ │ - Compare With: 0
│ │
│ │ └─ Action:
│ │ - Set Variable Value
│ │ hotbar_timeout = {"placeholder":"calc","values":{"decimal":"false","expression":"{"placeholder":"getvariable","values":{"name":"hotbar_timeout"}} - 1"}}
│ │
│ └─ ELSE
│ └─ Action:
│ - Set Variable Value
│ hotbar_visible:false
│
└─ ELSE
├─ Action:
│ - Set Variable Value
│ hotbar_visible:true
├─ Action:
│ - Set Variable Value
│ hotbar_timeout:3
└─ Action:
- Set Variable Value
last_hotbar_slot:{"placeholder":"active_hotbar_slot"}
What this means
- Top IF = slot stayed the same
- then it counts down the timer
- Top ELSE = slot changed
- then it shows the hotbar again and resets the timer
Don’t forget
On the hotbar, selector, and slot elements:
- add loading requirement:
hotbar_visible:true - enable fading on those elements
If you want, I can also give you the same thing as a super short “click this, then that” setup list 👋
✅ | Animated custom sliding hotbar selection image element?