Class UI2dContext

All Implemented Interfaces:
UIContainer, UILayer, LXLoopTask, Iterable<UIObject>
Direct Known Subclasses:
LXStudio.UI.MainContext, UI2dScrollContext, UILoading, UIRestrictions

public class UI2dContext extends UI2dContainer implements UILayer
  • Constructor Details

    • UI2dContext

      public UI2dContext(UI ui, float x, float y, float w, float h)
      Constructs a new UI2dContext
      Parameters:
      ui - the UI to place it in
      x - x-position
      y - y-position
      w - width
      h - height
  • Method Details

    • setOffscreen

      public UI2dContext setOffscreen(boolean isOffscreen)
    • getTexture

      public short getTexture()
    • getPaint

      public VGraphics.Paint getPaint()
    • render

      protected final void render(VGraphics vg, short viewId)
      Renders the content of the context to its own framebuffer. Note that this method assumes that all nested VGraphics instances beneath this one in the tree have themselves already been rendered. This is because NanoVG is not re-entrant and we share one instance.
      Parameters:
      vg - VGraphics instance
    • draw

      public final void draw(UI ui, View view)
      Draws the context into a parent view. This method assumes that this context's framebuffer texture has already been generated and is ready to be drawn.
      Specified by:
      draw in interface UILayer
      Parameters:
      ui - UI context
      view - Parent view to draw into
    • draw

      public void draw(UI ui, VGraphics vg)
      Draws this context into the given graphics context. Note that in this case we assume our framebuffer is already drawn and that we're just blitting it into a parent 2d context.
      Parameters:
      ui - UI context
      vg - Graphics context
    • onResize

      protected void onResize()
      Description copied from class: UI2dComponent
      Subclasses may override this method, invoked when the component is resized
      Overrides:
      onResize in class UI2dComponent
    • dispose

      public void dispose()
      Overrides:
      dispose in class UIObject