Original Source
- Original title: MZ "Is Selected" Check
- Original author: chris-cote
- Original date: December 22, 2023
- Source thread: https://forums.rpgmakerweb.com/threads/is-selected-check.164045/
- Source forum path: Game Development Engines > RPG Maker Javascript Plugins > Learning Javascript
Summary
Hi folks, I am modifying a bit of code from an existing plugin (with permission) to suit my game, and the objective is to have item names in the inventory only display when the "cursor" is over them (ie. when you are selecting it in the inventory, with the displayed name changing as you move between items). This is the code to display all of the item names in the inventory right now: Code:
Archived First Post
I am modifying a bit of code from an existing plugin (with permission) to suit my game, and the objective is to have item names in the inventory only display when the "cursor" is over them (ie. when you are selecting it in the inventory, with the displayed name changing as you move between items).
This is the code to display all of the item names in the inventory right now:
this.drawText(item.name, x + textMargin, y, itemWidth);
and my hope is to add a condition for displaying the name, which checks the item against the current selected item before displaying, like this:
if(this item is selected){
this.drawText(item.name, x + textMargin, y, itemWidth);
}
The idea is that I only want to see one item name rendered at a time, the one I am hovering over. I am hoping there is a function that gets the currently selected item so I can compare it to the item, and only display the name if they match or something like that.
Is there something that checks for this?
Thanks!
NOTE: The plugin specifically is DM_LimitedInventory, and this window I am modifying is defined on line 2870. It is free if you are able to take a look at it: HERE
Downloads / Referenced Files
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadCreator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
Topic Summary
Loading summary...