Navigation

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

    Can shapes overlap with sprites?

    Beginners
    3
    5
    221
    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.
    • vinicity
      vinicity F last edited by

      Hi!

      I want one of my sprites to disappear under a shape drawn with drawShape(). Is that possible?
      I tried experimenting with changing the sprite visual depth with setSpriteDepth(), but that seems to only affect its depth position relative to other sprites...

      I am grateful for any help!

      1 Reply Last reply Reply Quote 0
      • LinkCraft
        LinkCraft F last edited by

        I don’t know if this is what you want but...
        you could pixel draw the shape and turn that image into a sprite and have the other sprite go behind it

        1 Reply Last reply Reply Quote 1
        • Retrocade_media
          Retrocade_media F last edited by Retrocade_media

          Its all about draw order
          If you say
          DrawSprites()
          DrawShapes()

          Then all shapes will draw in front of sprites,
          Likewise for shapes behind. However you can also do:

          DrawShapes()
          DrawSprites()
          DrawShape(ShapeName)

          This will end up drawing all the shapes, then your sprites, and then just the one shape again, placing it in front of everything else. However, you should always use the CreateShape functions and not straight drawshape, as Drawshape will ignore your camera and just use screen coordinates, making a heck of a lot more math for you.

          vinicity 1 Reply Last reply Reply Quote 2
          • vinicity
            vinicity F @Retrocade_media last edited by

            Thanks a lot. I think Retrocade's answer is exactly what I needed!

            However, I am a bit confused about this:

            This will end up drawing all the shapes, then your sprites, and then just the one shape again, placing it in front of everything else. However, you should always use the CreateShape functions and not straight drawshape, as Drawshape will ignore your camera and just use screen coordinates, making a heck of a lot more math for you.

            Don't you always have to do a CreateXXX() to get a handle before doing DrawShape()? How do you use "straight drawshape"? In which cases will my camera be ignored?

            Thanks!

            Retrocade_media 1 Reply Last reply Reply Quote 0
            • Retrocade_media
              Retrocade_media F @vinicity last edited by

              @vinicity
              Oh right, I can see how thats confusing. The "Straight Drawshape" functions I was mentioning are just the square(), circle(), etc. functions.

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