License from €75 Log in
DE EN FR ES IT CZ

Changing the image of the inventory item when it comes over a scene object?

This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials

  1. · 12 years ago
    Hi there,

    How I can change the image of the selected item when it comes over a scene object? For example, I click the item "key" from inventory and move it over the door object in the scene. And when the cursor (item key) on the door object, I want to change the image of the item key, so user can understand key can be used on the door.

    Thank you smile
  2. Working on a game?

    The free version covers up to 25 scenes per project. For more scenes and to sell your game, you need a license.

    See licenses Try it for free
  3. · 12 years ago
    I'm not sure if you can change the item image, atleast i didn't find how.
  4. · 12 years ago
    So mate, what u do for this situation? You take the item and how u make it understandable that, it can be used on that object?
  5. · 12 years ago
    normally via the actiontext you can tell the player thatvthere is an Object.
    Nevertheless it would be cool to have a colored border (image) around that item when it hovers interactable objects or other items.
    I think that could be done in 2 ways:
    1. Make 2 items for each item and change the item when it hovers an object to the other and the other way around. I think this is a solution even if it is very hard to implement.
    2. Changing the Items sprite Image via Lua when it hovers objects and thr other way around.
    3. Use an animation for each item and try to switch it to a second one when hovering an object. Maybe also doablenwith lua

  6. · 12 years ago
    Well i don't do anything in that case... grin
    You can detect if some item is held and if so then check the item name.
    So i guess the workaround would be to have 2 versions for each item active & not active and on the hover you would set the active item as held and on the cursor leaves the normal again.
    But it's so much additional work.. but maybe some function could handle that.

    This is what i tried but it doesn't do anything

    local itm = game.GameUsedItem:getName()
    
    if itm ~= "" then
    local obj = getObject("Objects[" .. itm .. "]")
    obj.ObjectSprite.SpriteSprite = {"path", "0", "0", {"0", "0"}}
    end
    
  7. · 12 years ago
    the image sprite is a field in the objecttable of an item, so i think it can be changed. Its worth a try.
  8. · 12 years ago
    Thank you so much mate!! I'l try your ideas, hope I'll make it worksmile
  9. · 12 years ago
    im not at home right now but i found this with the mobile version of the forum:
    http://www.visionaire-studio.net/mobile/#forum/thread/25374/1/
  10. · 12 years ago
    why does the forum trim doen the mobile links so they doesnt work anymore xD?

    @AkcayKaraazmak Search for " item highlight " in the forum.
  11. · 12 years ago
    Thhank you bro! I cant see anything on that page something related with item highlight :\ Isnt the page is http://www.visionaire-studio.net/mobile ?
  12. · 12 years ago

This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.

New thread

Really delete this post?