Interface IPackedColorPanel

All Known Implementing Classes:
ImageSquidPanel, SparseLayers, SquidMessageBox, SquidPanel, SubcellLayers

public interface IPackedColorPanel
Created by Tommy Ettinger on 8/5/2017.
  • Method Summary

    Modifier and Type Method Description
    void blend​(int x, int y, float color, float mixBy)
    Using the existing color at the position x,y, this performs color blending from that existing color to the given color (as a float), using the mixBy parameter to determine how much of the color parameter to use (1f will set the color in this to the parameter, while 0f for mixBy will ignore the color parameter entirely).
    int cellHeight()  
    int cellWidth()  
    void clear​(int x, int y)
    Removes the contents of this cell, leaving a transparent space.
    com.badlogic.gdx.graphics.Color getDefaultForegroundColor()  
    int gridHeight()  
    int gridWidth()  
    boolean hasActiveAnimations()  
    void put​(char[][] foregrounds, com.badlogic.gdx.graphics.Color[][] colors)  
    void put​(int x, int y, char c)
    Puts the character c at (x, y).
    void put​(int x, int y, char c, float encodedColor)
    Places a char in the given color at the given x,y position; if the implementation has a separate background from the foreground characters, this will not affect it.
    void put​(int x, int y, char c, com.badlogic.gdx.graphics.Color color)
    Puts the character c at (x, y) with some color.
    void put​(int x, int y, float color)
    Places a full cell of color at the given x,y position; this may be used as a background or foreground, depending on the implementation.
    void put​(int x, int y, com.badlogic.gdx.graphics.Color color)
    Puts color at (x, y) (in the cell's entirety, i.e.
    void put​(int xOffset, int yOffset, String string, com.badlogic.gdx.graphics.Color foreground)
    Puts the given string horizontally with the first character at the given offset.
    void put​(int xOffset, int yOffset, IColoredString<? extends com.badlogic.gdx.graphics.Color> cs)
    Puts the given string horizontally with the first character at the given offset, using the colors that cs provides.
    void setDefaultForeground​(com.badlogic.gdx.graphics.Color color)
    Sets the default foreground color.
  • Method Details

    • put

      void put​(int x, int y, float color)
      Places a full cell of color at the given x,y position; this may be used as a background or foreground, depending on the implementation. The color is given as a packed float, the kind produced by Color.toFloatBits(). If the implementation performs color filtering on Color objects, it generally won't on packed float colors.
      Parameters:
      x - x position of the cell
      y - y position of the cell
      color - color for the full cell as a packed float, as made by Color.toFloatBits()
    • blend

      void blend​(int x, int y, float color, float mixBy)
      Using the existing color at the position x,y, this performs color blending from that existing color to the given color (as a float), using the mixBy parameter to determine how much of the color parameter to use (1f will set the color in this to the parameter, while 0f for mixBy will ignore the color parameter entirely).
      Parameters:
      x - the x component of the position in this panel to draw the starting color from
      y - the y component of the position in this panel to draw the starting color from
      color - the new color to mix with the starting color; a packed float, as made by Color.toFloatBits()
      mixBy - the amount by which the new color will affect the old one, between 0 (no effect) and 1 (overwrite)
    • put

      void put​(int x, int y, char c, float encodedColor)
      Places a char in the given color at the given x,y position; if the implementation has a separate background from the foreground characters, this will not affect it. The color is given as a packed float, the kind produced by Color.toFloatBits(). If the implementation performs color filtering on Color objects, it generally won't on packed float colors.
      Parameters:
      x - x position of the char
      y - y position of the char
      c - the char to put at the given cell
      encodedColor - the color for the char as a packed float, as made by Color.toFloatBits()
    • put

      void put​(int x, int y, char c)
      Puts the character c at (x, y).
      Parameters:
      x -
      y -
      c -
    • put

      void put​(int x, int y, com.badlogic.gdx.graphics.Color color)
      Puts color at (x, y) (in the cell's entirety, i.e. in the background).
      Parameters:
      x -
      y -
      color -
    • put

      void put​(int xOffset, int yOffset, String string, com.badlogic.gdx.graphics.Color foreground)
      Puts the given string horizontally with the first character at the given offset. Does not word wrap. Characters that are not renderable (due to being at negative offsets or offsets greater than the grid size) will not be shown but will not cause any malfunctions.
      Parameters:
      xOffset - the x coordinate of the first character
      yOffset - the y coordinate of the first character
      string - the characters to be displayed
      foreground - the color to draw the characters
    • put

      void put​(int xOffset, int yOffset, IColoredString<? extends com.badlogic.gdx.graphics.Color> cs)
      Puts the given string horizontally with the first character at the given offset, using the colors that cs provides. Does not word wrap. Characters that are not renderable (due to being at negative offsets or offsets greater than the grid size) will not be shown but will not cause any malfunctions.
      Parameters:
      xOffset - the x coordinate of the first character
      yOffset - the y coordinate of the first character
      cs - The string to display, with its colors.
    • put

      void put​(int x, int y, char c, com.badlogic.gdx.graphics.Color color)
      Puts the character c at (x, y) with some color.
      Parameters:
      x -
      y -
      c -
      color -
    • put

      void put​(char[][] foregrounds, com.badlogic.gdx.graphics.Color[][] colors)
      Parameters:
      foregrounds - Can be null, indicating that only colors must be put.
      colors -
    • clear

      void clear​(int x, int y)
      Removes the contents of this cell, leaving a transparent space.
      Parameters:
      x -
      y -
    • gridWidth

      int gridWidth()
      Returns:
      The number of cells that this panel spans, horizontally.
    • gridHeight

      int gridHeight()
      Returns:
      The number of cells that this panel spans, vertically.
    • cellWidth

      int cellWidth()
      Returns:
      The width of a cell, in number of pixels.
    • cellHeight

      int cellHeight()
      Returns:
      The height of a cell, in number of pixels.
    • hasActiveAnimations

      Returns:
      Returns true if there are animations running when this method is called.
    • setDefaultForeground

      void setDefaultForeground​(com.badlogic.gdx.graphics.Color color)
      Sets the default foreground color.
      Parameters:
      color -
    • getDefaultForegroundColor

      com.badlogic.gdx.graphics.Color getDefaultForegroundColor()
      Returns:
      The default foreground color (if none was set with setDefaultForeground(Color)), or the last color set with setDefaultForeground(Color). Cannot be null.