How can I set the transparency of a view?

Discussion in 'Programming' started by JopRillos2001, Jun 10, 2019.

  1. JopRillos2001

    JopRillos2001 Member

    Joined:
    Sep 18, 2018
    Posts:
    19
    Im making a map with a minimap, but the minimap is a view of the room, but smaller. The player can get behind the view, and this is all good, but now I cant see the player.

    Can I make the view transparent so I can see the map, and the player?

    If this isnt possible, what should I do to make the minimap work?
     
  2. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,376
    You can use view_surface_id and then draw the view yourself (with transparency)
     
    Rukiri likes this.
  3. JopRillos2001

    JopRillos2001 Member

    Joined:
    Sep 18, 2018
    Posts:
    19
    And how do I set the transparency using view_surface_id?
     
  4. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,376
    by drawing the your view-surface via draw_surface_ext
     
  5. JopRillos2001

    JopRillos2001 Member

    Joined:
    Sep 18, 2018
    Posts:
    19
  6. kupo15

    kupo15 Member

    Joined:
    Jun 20, 2016
    Posts:
    769
    Why don't you manually code the minimap as a GUI draw in the normal draw event and position it before the player gets drawn so that way the player gets drawn on top?
    xx = camera_x+Gui_coor
    yy = camera_y+Gui_coor

    Or something to that effect if you want to use a different reference
     
  7. JopRillos2001

    JopRillos2001 Member

    Joined:
    Sep 18, 2018
    Posts:
    19
    Ive been stuck on this for days, and this still doesnt give me enough to get it right. Could you give a little more info?
     
  8. kupo15

    kupo15 Member

    Joined:
    Jun 20, 2016
    Posts:
    769
    what part are you stuck on? Also, why are you using another view for the minimap? If its already been created on a surface, why not just draw the surface normally without assigning it to a view_surface? I don't understand why using multiple views is necessary in general tbh
     
  9. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,376

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice