Add Window to a viewport?

● ARCHIVED · READ-ONLY
Started by Napoleon 3 posts View original ↗
  1. I want my Window to be on top of other viewports. So just adjusting the z-index isn't enough. But I can't get it to work and the documentation doesn't explain it either:

    viewportRefers to the viewport (Viewport) associated with the window.
    Code:
    class Window_Popup < Window_Base  @@nap_viewport = Viewport.new  @@nap_viewport.z = 999  def initialize(..)    #@viewport = @@nap_viewport # Doesn't do anything.    viewport = @@nap_viewport # Doesn't do anything.    #self.viewport = @@nap_viewport # Obviously crashes because using "self" during the initialize()...    ..  end  ..end
    At least Window.viewport is both a setter and a getter. But the above does absolutely nothing. I don't get it, where/how do I set the viewport?
  2. Of course it crashes because you haven't call the original initialize method

    It won't crash if you do it in this way

    Code:
    def initialize(...)  super  self.viewport = @@nap_viewportend
  3. Ah of course... I figured that the setter did more than just assigning the variable. I just forgot to place it AFTER super(..). Thanks.