Interface PlayfieldDrawer


  • public interface PlayfieldDrawer
    The interface for a playfield drawer used by a GameWindow.
    Author:
    Tim Neumann
    • Method Detail

      • setDrawables

        void setDrawables​(List<Drawable> drawables)
        Set the current list of Drawables to be rendered onto the playfield. No defensive copy of this list is made and the list may be sorted in place.
        Parameters:
        drawables - the list of Drawables to render
      • draw

        void draw​(long tickCount)
        Draws the playfield.
        Parameters:
        tickCount - The number of the current tick
      • resetZoomAndPan

        void resetZoomAndPan()
        Reset Zoom and Pan applied by the user to the default values.
      • setDoubleBuffering

        void setDoubleBuffering​(boolean useDoubleBuffering)
        Parameters:
        useDoubleBuffering - true (default) uses doubleBuffering when rendering changes on the playfield.
      • setSyncToScreen

        void setSyncToScreen​(boolean syncToScreen)
        Parameters:
        syncToScreen - true (default) actively tries to sync the updated graphics to the screen after rendering changes on the playfield.
      • setSelectedTool

        void setSelectedTool​(Toolbar.ControlButtonState selectedTool)
        Inform the playfield drawer about which tool is selected in the toolbar. This influences what happens when a user clicks on the playfield.
        Parameters:
        selectedTool - The currently selected tool
      • setSelectedEntityType

        void setSelectedEntityType​(String typeName,
                                   String textureHandle)
        Inform the playfield drawer about which entity type is selected in the toolbar. This influences what entity is spawned when a user uses the entity creation tool.
        Parameters:
        typeName - The name of the entity type selected.
        textureHandle - The texture handle for the entity type selected.