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

Object Sprite check

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

  1. · 12 years ago
    Can anyone tell me how i can use Lua to check an object has a sprite, so i can prevent throwing an error.

    if (obj.ObjectSprite) == null then
    -- return false
    else
    -- return true
    end
  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
    Hi not sure if it's the shortest way though.

    if getObject("Scenes[name].SceneObjects[name]"):getLink(VObjectSprite):isEmpty() then
    -- it's empty (true)
    else
    -- object has sprite (false)
    end
    

  4. · 12 years ago
    Thanks

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?