Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    What is the data type of a handle

    Coding
    2
    3
    264
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      stevenwu F last edited by

      Hello
      I can get a sprite handle using createSprite

      playerSpr = createSprite()
      

      or a image handle using loadImage

      playerImg = loadImage( "Untied Games/Player ships", false )
      

      Is the playerSpr an int? Can I use it in a struct like this?

      Struct hero
          int sprite
          int image
      Endstruct
      
      pianofire 1 Reply Last reply Reply Quote 0
      • pianofire
        pianofire Fuze Team @stevenwu last edited by

        @stevenwu Yes you can do that. However as you are using sprites you can take advantage of the fact that sprites have properties and that you can also define your own.

        so if you do

        playerSpr = createSprite()
        

        You can access the sprite image using

        playerSpr.image
        

        And if you want to create a property you just assign it

        playerSpr.hitpoints = 10
        

        See here for a list of built in properties https://fuzearena.com/forum/topic/521/sprite-properties

        S 1 Reply Last reply Reply Quote 4
        • S
          stevenwu F @pianofire last edited by

          @pianofire It's very helpful, thank you.

          1 Reply Last reply Reply Quote 3
          • First post
            Last post