Navigation

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

    Transparent image.

    Coding
    2
    3
    228
    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.
    • R
      Richard F last edited by

      When an image is created in code it appears to be a black box by default is there a way to make it blank not black so the image behind can be seen?
      The code below shows what I mean:

      box(100,100,150,150,red, false)
      image =createImage(50,50,false,image_rgb)
      setDrawTarget(image)
      box(1,1,48,48,white,true)
      setDrawTarget (frameBuffer)
      drawImage(image,150,150)
      update()
      sleep(2)
      

      This draws a red square with the white outline of a square on top which is filled in black (there is no code to draw the black square). What I want is to be able to see the red of the first square through the second square. I know I could get round this by not using images, but for the game I'm working on it gets a lot more complicated than two squares, this is just to show the principle of how the code works.

      1 Reply Last reply Reply Quote 0
      • N
        Nisse5 F last edited by

        When you create the image, use "image_rgba" instead.

        (This value is currently only documented in the online version of the help.)

        R 1 Reply Last reply Reply Quote 3
        • R
          Richard F @Nisse5 last edited by

          @Nisse5 thank you that's fixed it. I wondered what the other possible image types were after reading the in game help.

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