JCAP Integrated Development Environment (JIDE) Documentation¶
Main JIDE Class¶
-
class
jide.
jide
[source]¶ This is the primary class which serves as the glue for JIDE.
This class interfaces between the various canvases, pixel and color palettes, centralized data source, and data output routines.
-
setCopyActive
(active)[source]¶ Set whether the copy action is available
- Parameters
active (bool) – Variable representing whether copy action should be set to available or unavailable
-
setPasteActive
(active)[source]¶ Set whether the paste action is available
- Parameters
active (bool) – Variable representing whether paste action should be set to available or unavailable
-
loadProject
(file_name)[source]¶ Load project file data and populate UI elements/set up signals and slots
-
setCanvas
(index)[source]¶ Set the dock and signal/slot layout to switch between sprite/tile/ tile map tabs
- Parameters
index (int) – Index of canvas tab
-
genPixelDATFile
(source, path)[source]¶ Generate sprite/tile pixel palette .dat file
- Parameters
source (list) – List containing sprite/tile pixel data
path (str) – File path to .dat
-
Game Data Management¶
-
class
gamedata.
ColorPalettes
(data, source, parent=None)[source]¶ Data container for sprite/tile color palettes
- Parameters
data (list(dict)) – List containing JSON color palette data
source (Source) – Subject source of palette, either sprite or tile
parent (QWidget, optional) – Parent widget, defaults to None
-
keys
()[source]¶ Retrieve color palette dict keys
- Returns
Color palette dict keys
- Return type
odict_keys
-
values
()[source]¶ Retrieve color palette dict values
- Returns
Color palette dict values
- Return type
odict_values
-
items
()[source]¶ Retrieve color palette dict items
- Returns
Color palette dict items
- Return type
odict_items
-
setName
(cur_name, new_name)[source]¶ Sets the names of a color palette
- Parameters
cur_name (str) – Name of target color palette
new_name (str) – New name for color palette
-
class
gamedata.
PixelPalettes
(data, source, parent=None)[source]¶ Data container for sprite/tile pixel palettes
- Parameters
data (list(dict)) – List containing JSON pixel palette data
source (Source) – Subject source of palette, either sprite or tile
parent (QWidget, optional) – Parent widget, defaults to None
-
class
gamedata.
GameData
(data, parent=None)[source]¶ Represents centralized data object for JIDE, containing all sprite/tile/ tile map data and CRUD functions
- Parameters
data (dict) – Dict containing project JSON data
parent (QWidget, optional) – Parent widget, defaults to None
-
getPixelPalettes
(source)[source]¶ Retrieve sprite/tile pixel palettes
- Parameters
source (Source) – Subject source of palettes, either sprite or tile
- Returns
Pixel palettes
- Return type
list
-
getElement
(index, source)[source]¶ Retrieve a sprite/tile pixel value
- Parameters
index (tuple(int, int, int)) – Index/row/col of pixel
source (Source) – Subject source of pixel, either sprite or tile
- Returns
Pixel value at index
- Return type
int
-
getColPals
(source)[source]¶ Retrieve sprite/tile color palettes
- Parameters
source (Source) – Subject source of palettes, either sprite or tile
- Returns
Color palettes of target source
- Return type
list
-
getColPalNames
(source)[source]¶ Retrieve sprite/tile color palette names
- Parameters
source (Source) – Subject source of palette names, either sprite or tile
- Returns
Names of target source color palettes
- Return type
list
-
getColPal
(name, source)[source]¶ Retrieve a specific sprite/tile color palette
- Parameters
name (str) – Name of color palette to retrieve
source (Source) – Subject source of palette, either sprite or tile
- Returns
Color palette specified by name
- Return type
list
-
setColor
(name, index, color, source, orig=None)[source]¶ Sets a color in a specific color palette
- Parameters
name (str) – Name of color palette containing target color
index (int) – Index of color in color palette
color (QColor) – New color to be set to
source (Source) – Subject source of target palette, either sprite or tile
orig (QColor, optional) – Original color of the target color, defaults to None
-
previewColor
(name, index, color, source)[source]¶ Previews a color without committing it to the data; used by colorpalette.ColorPreview
- Parameters
name (str) – Name of color palette containing target color
index (int) – Index of color in color palette
color (QColor) – Color to preview
source (Source) – Subject source of target palette, either sprite or tile
-
setColPalName
(cur_name, new_name, source)[source]¶ Set name of a color palette
- Parameters
cur_name (str) – Current name of target color palette
new_name (str) – New name for target palette
source (Source) – Subject source of target palette, either sprite or tile
-
addColPal
(name, source)[source]¶ Add a new color palette
- Parameters
name (str) – Name for the new color palette
source (Source) – Subject source of new palette, either sprite or tile
-
remColPal
(name, source)[source]¶ Remove a color palette
- Parameters
name (str) – Name for the target color palette
source (Source) – Subject source of target palette, either sprite or tile
-
setPixBatch
(batch, source)[source]¶ Sets pixels to new values based on the contents of a set of pixel deltas
- Parameters
batch (defaultdict) – Set of pixel deltas represented by pixel indexes and new values
source ([type]) – Subject source of pixels, either sprite or tile
-
addPixRow
(source)[source]¶ Add a new row of sprites or tiles
- Parameters
source (Source) – Subject source to add the row to, either sprite or tile
-
remPixRow
(source)[source]¶ Remove a row of sprites or tiles
- Parameters
source (Source) – Subject source to remove the row from, either sprite or tile
-
setUndoStack
(undo_stack)[source]¶ Sets the undo stack for the GameData object
- Parameters
undo_stack (QUndoStack) – The undo stack to set
-
classmethod
fromFilename
(file_name, parent=None)[source]¶ Class method to instantiate the GameData object from a JSON file containing project data
- Parameters
file_name (str) – Path to project data JSON file
parent (QWidget, optional) – Parent widget for GameData object, defaults to None
- Returns
Instance of GameData instantiated with data from file
- Return type
Undo/Redo History Management¶
-
class
history.
cmdSetCol
(palette, name, index, color, orig, desc, parent=None)[source]¶ Sets a color in a color palette
- Parameters
palette (gamedata.ColorPalettes) – Target set of color palettes
name (str) – Name of target color palette
index (int) – Index of target color
color (QColor) – New color to set to
orig (QColor) – Original color
desc (Str) – Text description of action
parent (QWidget, optional) – Parent widget, defaults to None
-
class
history.
cmdSetColPalName
(palette, cur_name, new_name, desc, parent=None)[source]¶ Set the name of a color palette
- Parameters
palette (gamedata.ColorPalettes) – Target set of color palettes
cur_name (str) – Target name of color palette
new_name (str) – New name for color palette
desc (str) – Text description of action
parent (QWidget, optional) – Parent widget, defaults to None
-
class
history.
cmdAddColPal
(palette, name, contents, desc, parent=None)[source]¶ Add a new sprite/tile color palette
- Parameters
palette (gamedata.ColorPalettes) – Target set of color palettes
name (str) – Name of target color palette
contents (list) – Contents of new color palette
desc (str) – Text description of action
parent (QWidget, optional) – Parent widget, defaults to None
-
class
history.
cmdRemColPal
(palette, name, desc, parent=None)[source]¶ Remove a sprite/tile color palette
- Parameters
palette (gamedata.ColorPalettes) – Target set of color palettes
name (str) – Name of target color palette
desc (str) – Text description of action
parent (QWidget, optional) – Parent widget, defaults to None
-
class
history.
cmdSetPixBatch
(palette, batch, desc, parent=None)[source]¶ Apply a pixel batch update
- Parameters
palette (gamedata.PixelPalettes) – Target set of pixel palettes
batch (defaultdict) – Set of pixel deltas represented by pixel indexes and new values
desc (str) – Text description of action
parent (QWidget, optional) – Parent widget, defaults to None
-
class
history.
cmdAddPixRow
(palette, desc, parent=None)[source]¶ Add a row of sprite/tiles to a pixel palette
- Parameters
palette (gamedata.PixelPalettes) – Target set of pixel palettes
desc (str) – Text description of action
parent (QWidget, optional) – Parent widget, defaults to None
-
class
history.
cmdRemPixRow
(palette, desc, parent=None)[source]¶ Remove a row of sprite/tiles from a pixel palette
- Parameters
palette (gamedata.PixelPalettes) – Target set of pixel palettes
desc (str) – Text description of action
parent (QWidget, optional) – Parent widget, defaults to None
Canvas Display/Manipulation¶
-
class
canvas.
GraphicsView
(scene=None, parent=None)[source]¶ QGraphicsView into sprite/tile canvas
- Parameters
scene (QGraphicsScene, defaults to None) – QGraphicsScene representing sprite/tile canvas
parent (QWidget) – Parent widget, defaults to None
-
class
canvas.
Subject
(parent=None)[source]¶ Object representing pixel contents of canvas
- Parameters
parent (QWidget) – Parent widget, defaults to None
-
setPixel
(x, y, value)[source]¶ Set value of pixel in subject at (x,y) coordinates
- Parameters
x (int) – X-coordinate of pixel
y (int) – Y-coordinate of pixel
value (int) – Color table index value to set pixel to
-
setColorTable
(colors)[source]¶ Set color table of currently rendered subject
- Parameters
colors (list(int)) – List of colors to set color table to
-
setWidth
(width)[source]¶ Set width of subject in pixels
- Parameters
width (int) – New width of subject in pixels
-
class
canvas.
Overlay
(parent=None)[source]¶ Overlay of canvas which handles graphics tools interactions
- Parameters
parent (QWidget, optional) – Parent widget, defaults to None
-
setTool
(tool, filled=False)[source]¶ Sets the active tool based on user selection in toolbar
- Parameters
tool (Tools) – Tool selection
filled (bool, optional) – Whether a selected shape tool will be filled or outline, defaults to False
-
setColor
(color)[source]¶ Sets the color of the selected tool
- Parameters
color (int) – Color of the selected tool to set
-
setWidth
(width)[source]¶ Set the width of the overlay to remain consistent with the underlying subject
- Parameters
width (int) – New width of the overlay
-
setHeight
(height)[source]¶ Set the height of the overlay to remain consistent with the underlying subject
- Parameters
width (int) – New height of the overlay
-
floodFill
(x, y)[source]¶ Recursive floodfill tool entry point
- Parameters
x (int) – Starting x coordinate for floodfill
y (int) – Starting y coordinate for floodfill
-
fillPixel
(x, y, old_color, new_color)[source]¶ Recursive floodfill function
- Parameters
x (int) – Current x coordinate
y (int) – Current y coordinate
old_color (int) – Target color to fill
new_color (int) – New color to replace target color
-
setColorTable
(color_table)[source]¶ Set color table used by overlay when pasting
- Parameters
color_table (list(int)) – List of RGB values to set color table to
-
hoverMoveEvent
(event)[source]¶ Mouse hover move event for handling updating pasting location
- Parameters
event (QGraphicsSceneHoverEvent) – Source event
-
renderPaste
(position)[source]¶ Render a currently pasting pixel region onto the overlay
- Parameters
position (QPointF) – Location on overlay to render paste
-
mousePressEvent
(event)[source]¶ Mouse press event to handle mouse clicks with various tools
- Parameters
event (QGraphicsSceneMouseEvent) – Source event
-
mouseMoveEvent
(event)[source]¶ Mouse move event to handle mouse movement after clicking with various tools
- Parameters
event (QGraphicsSceneMouseEvent) – Source event
-
mouseReleaseEvent
(event)[source]¶ Mouse release event to handle mouse release with various tools
- Parameters
event (QGraphicsSceneMouseEvent) – Source event
-
class
canvas.
GraphicsScene
(data, source, parent=None)[source]¶ Canvas representing the current state of the subject including overlayed grid lines
- Parameters
-
setColorSwitchEnabled
(enabled)[source]¶ Emits signal to disable the color palette primary/secondary color switch functionality
- Parameters
enabled (bool) – Whether to enable or disable the switch functionality
-
setSubject
(root, width, height)[source]¶ Sets the pixel contents of the canvas
- Parameters
root (int) – The root index of the tiles/sprites to be rendered
width (int) – The width of sprites/tiles starting at the root to render
height (int) – The height of sprites/tiles starting at the root to render
-
setTool
(tool)[source]¶ Set the current tool being used on the canvas
- Parameters
tool (Tools) – Current tool to be used
-
setColorPalette
(palette)[source]¶ Set the color palette used by the canvas subject
- Parameters
palette (str) – Name of the target color palette
-
setPrimaryColor
(color)[source]¶ Set the color used by graphics tools
- Parameters
color (int) – Index of the color in the current color table to be set as the primary
-
selectRegion
(region)[source]¶ Select a region of pixels chosen with the select tool
- Parameters
region (QRect) – Rectangular region of pixels to select
-
bakeDiff
(image)[source]¶ Generate a differential list of pixel values based on the overlay and bake it onto the centralized GameData data.
- Parameters
image (QImage) – Image derived from overlay to bake
-
bakeOverlay
(overlay)[source]¶ Bake the overlay data directly into the centralized GameData data
- Parameters
overlay (QImage) – Overlay to bake
Sprite/Tile Palette Display¶
-
class
pixelpalette.
Overlay
(parent=None)[source]¶ Pixel palette overlay used to draw gridlines and selection box
- Parameters
parent (QWidget, optional) – Parent widget, defaults to None
-
setDims
(height)[source]¶ Set height in sprites/tiles of pixel palette
- Parameters
height (int) – Number of rows in pixel palette
-
selectSubjects
(root, width, height)[source]¶ Select rectangular region of sprites/tiles
- Parameters
root (int) – Index of root selected element
width (int) – Width of selection from root
height (int) – Height of selection from root
-
paintEvent
(event)[source]¶ Paint event for the overlay
- Parameters
event (QPaintEvent) – QPaintEvent event
-
getCoords
(event)[source]¶ Get bounded coordinates of a mouse event
- Parameters
event (QMouseEvent) – Source event
- Returns
Bounded horizontal and vertical coordinate of mouse event
- Return type
tuple(int, int)
-
clamp
(value, lower=0, upper=16)[source]¶ Clamp a coordinate to bounded dimensions
- Parameters
value (int) – Value to clamp
lower (int, optional) – Lower bound of clamp, defaults to 0
upper (int, optional) – Upper bound of clamp, defaults to 16
- Returns
Clamped coordinate
- Return type
int
-
class
pixelpalette.
Tile
(index, parent=None)[source]¶
-
class
pixelpalette.
PixelPalette
(source, parent=None)[source]¶ Palette of sprite/tiles to be used to select canvas editing area
- Parameters
source (Source) – Source subject of the palette, either tile or sprite
parent (QWidget, optional) – Parent widget, defaults to None
-
setup
(data)[source]¶ Sets up the data source for the palette and generates the palette
- Parameters
data (GameData) – Data source of palette
-
selectSubjects
(index=None, width=- 1, height=- 1)[source]¶ Selects a rectangular region of tiles in the palette. None and negative index/width/height values result in internal values being used.
- Parameters
index (int, optional) – Root index of selection, defaults to None
width (int, optional) – Width of selection from index, defaults to -1
height (int, optional) – Height of selection from index, defaults to -1
-
updateSubjects
(source, subjects)[source]¶ Updates the palette’s tiles with data from the centralized GameData
- Parameters
source (Source) – Source subject of update, either sprite or tile
subjects (set(int)) – A set of subject indexes which need to be updated
-
setColorPalette
(palette)[source]¶ Set the color palette to be used by the sprites/tiles
- Parameters
palette (str) – Name of the color palette
-
inSelection
(index)[source]¶ Determine if an index is inside the rectangular selection area
- Parameters
index (int) – Target index
- Returns
Whether the target index is inside the selection
- Return type
bool
-
class
pixelpalette.
Contents
(source, palette, parent=None)[source]¶ Visual contents of the pixel palette
- Parameters
source (Source) – Subject source of the contents, either sprite or tile
palette (PixelPalette) – Palette to render in contents
parent (QWidget, optional) – Parent widget, defaults to None
-
class
pixelpalette.
PixelPaletteDock
(source, parent=None)[source]¶ Dock containing the pixel palette
- Parameters
source (Source) – Subject source of the dock, either sprite or tile
parent (QWidget, optional) – Parent widget, defaults to None
Color Palette Display¶
-
class
colorpalette.
ColorPreview
(source, parent=None)[source]¶ Color preview widget showing primary and secondary color selections
- Parameters
source (Source) – Subject source of preview, either sprite or tile
parent (QWidget, optional) – Parent widget, defaults to None
-
paintEvent
(event)[source]¶ Preview paint event to draw regular and transparent color selections
- Parameters
event (QPaintEvent) – Paint event
-
setPrimaryColor
(color)[source]¶ Sets the primary color of the preview
- Parameters
color (QColor) – Color to be set as the primary
-
setPrimaryIndex
(index)[source]¶ Sets the index of the chosen primary color of the preview
- Parameters
index (int) – Index to be set as the primary
-
setSecondaryColor
(color)[source]¶ Sets the secondary color of the preview
- Parameters
color (QColor) – Color to be set as the secondary
-
class
colorpalette.
Color
(index, source, parent=None)[source]¶ Representation of a single color in the color palette
- Parameters
index (int) – Numerical index of the color in a color table
source (Source) – Source subject of the color, either sprite or tile
parent (QWidget, optional) – Parent widget, defaults to None
-
paintEvent
(event)[source]¶ Color paint event to draw grid and transaprency indications
- Parameters
event (QPaintEvent) – Paint event
-
mouseDoubleClickEvent
(event)[source]¶ Handles double clicking on a given color to open the color picker
- Parameters
event (QMouseEvent) – Source event
-
class
colorpalette.
ColorPalette
(source, parent=None)[source]¶ Represents a palette of colors
- Parameters
source (Source) – Subject source of the palette, either sprite or tile
parent (QWidget, optional) – Parent widget, defaults to None
-
setup
(data)[source]¶ Sets up the data source for the palette and initial selection
- Parameters
data (GameData) – Data source of palette
-
openPicker
(index, orig_color)[source]¶ Handles opening the color picker after double-clicking on a color
- Parameters
index (int) – Index of the color selected
orig_color (QColor) – Original color of the selection color
-
sendColorUpdate
(index, new_color, orig_color=None)[source]¶ Sends color update to centralized GameData data
- Parameters
index (int) – Index of changed color in palette
new_color (QColor) – Color to be changed to
orig_color (QColor, optional) – Original color, defaults to None
-
previewColor
(index, color)[source]¶ Triggers preview of color throughout application when interacting with color picker
- Parameters
index (int) – Index of the color being changed
color (QColor) – Color to be previewed
-
class
colorpalette.
ColorPaletteDock
(source, parent=None)[source]¶ Dock containing the color palette and preview area
- Parameters
source (Source) – Subject source for the dock and its contents, either sprite or tile
parent (QWidget, optional) – Parent widget, defaults to None
-
setup
(data)[source]¶ Sets up the data source for the dock’s contents and enables UI elements
- Parameters
data (GameData) – Data source of dock
-
addPaletteReq
(event=None)[source]¶ Sends command to GameData source to add a color palette
- Parameters
event (QMouseEvent, optional) – Mouse click event which triggered the request, defaults to None
-
removePaletteReq
(event=None)[source]¶ Sends command to GameData source to remove a color palette
- Parameters
event (QMouseEvent, optional) – Mouse click event which triggered the request, defaults to None
-
renamePaletteReq
(event=None)[source]¶ Sends command to GameData source to rename a color palette
- Parameters
event (QMouseEvent, optional) – Mouse click event which triggered the request, defaults to None
-
addPalette
(source, name, index)[source]¶ Adds a new color palette
- Parameters
source (Source) – Subject source of the addition, either sprite or tile
name (str) – Name of the added color palette
index (int) – Index in color palette list to insert the new palette
-
removePalette
(source, name)[source]¶ Removes a color palette
- Parameters
source (Source) – Subject source of the removal, either sprite or tile
name (str) – Name of the removed color palette
-
renamePalette
(source, cur_name, new_name)[source]¶ Renames a color palette
- Parameters
source (Source) – Subject source of the removal, either sprite or tile
cur_name (str) – Current name of the target color palette
new_name (str) – New name of the target color palette
Color Picker Display¶
-
colorpicker.
upsample
(red, green, blue)[source]¶ Upsamples RGB from 8-bit to 24-bit
- Parameters
red (int) – 8-bit red value
green (int) – 8-bit green value
blue (int) – 8-bit blue value
- Returns
24-bit upscaled RGB tuple
- Return type
tuple(int, int, int)
-
colorpicker.
downsample
(red, green, blue)[source]¶ Downsamples RGB from 24-bit to 8-bit
- Parameters
red (int) – 24-bit red value
green (int) – 24-bit green value
blue (int) – 24-bit blue value
- Returns
8-bit downscaled RGB tuple
- Return type
tuple(int, int, int)
-
colorpicker.
normalize
(red, green, blue)[source]¶ Normalizes any RGB value to be representable by a whole 8-bit value
- Parameters
red (int) – Red value
green (int) – Green value
blue (int) – Blue value
- Returns
24-bit normalized RGB tuple
- Return type
tuple(int, int, int)
-
class
colorpicker.
Color
(index, parent=None)[source]¶ Represents a single color tile in the color picker
- Parameters
index (int) – Index of the color tile
parent (QWidget, optional) – Parent widget, defaults to None
-
fill
(color)[source]¶ Fills the tile with the specified color
- Parameters
color (QColor) – Target color
-
paintEvent
(event)[source]¶ Paint event for the color tile which draws the grid
- Parameters
event (QPaintEvent) – QPaintEvent event
-
class
colorpicker.
ColorPalette
[source]¶ Represents the entire grid of color tiles in the color picker
-
class
colorpicker.
ColorValidator
(top, parent=None)[source]¶ Provides input field validation to color picker RGB values
- Parameters
top (int) – RGB value ceiling
parent (QWidget, optional) – Parent widget, defaults to None
-
class
colorpicker.
ColorPicker
(parent=None)[source]¶ Represents the dialog containing the color picker
- Parameters
parent (QWidget, optional) – Parent widget, defaults to None
-
eventFilter
(source, event)[source]¶ Event filter to handle the dialog losing focus
- Parameters
source (QObject) – Event source
event (QEvent) – Source event
- Returns
Whether to handle the event further down
- Return type
bool
-
getColor
()[source]¶ Gets the chosen color from the color picker
- Returns
Chosen color
- Return type
QColor
Preferences Management¶
-
class
preferences.
Preferences
(parent=None)[source]¶ Represents the dialog containg the application settings
- Parameters
parent (QWidget, optional) – Parent widget, defaults to None
-
idUcs
()[source]¶ Executes the serial routines necessary to identify which COM ports the GPU and CPU are on
-
setCpuPort
(port)[source]¶ Sets the GPU COM port in preferences
- Parameters
port (str) – COM port hosting the CPU
Graphics Toolbox¶
-
class
gamedata.
ColorPalettes
(data, source, parent=None)[source]¶ Data container for sprite/tile color palettes
- Parameters
data (list(dict)) – List containing JSON color palette data
source (Source) – Subject source of palette, either sprite or tile
parent (QWidget, optional) – Parent widget, defaults to None
-
keys
()[source]¶ Retrieve color palette dict keys
- Returns
Color palette dict keys
- Return type
odict_keys
-
values
()[source]¶ Retrieve color palette dict values
- Returns
Color palette dict values
- Return type
odict_values
-
items
()[source]¶ Retrieve color palette dict items
- Returns
Color palette dict items
- Return type
odict_items
-
setName
(cur_name, new_name)[source]¶ Sets the names of a color palette
- Parameters
cur_name (str) – Name of target color palette
new_name (str) – New name for color palette
-
class
gamedata.
PixelPalettes
(data, source, parent=None)[source]¶ Data container for sprite/tile pixel palettes
- Parameters
data (list(dict)) – List containing JSON pixel palette data
source (Source) – Subject source of palette, either sprite or tile
parent (QWidget, optional) – Parent widget, defaults to None
-
class
gamedata.
GameData
(data, parent=None)[source]¶ Represents centralized data object for JIDE, containing all sprite/tile/ tile map data and CRUD functions
- Parameters
data (dict) – Dict containing project JSON data
parent (QWidget, optional) – Parent widget, defaults to None
-
getPixelPalettes
(source)[source]¶ Retrieve sprite/tile pixel palettes
- Parameters
source (Source) – Subject source of palettes, either sprite or tile
- Returns
Pixel palettes
- Return type
list
-
getElement
(index, source)[source]¶ Retrieve a sprite/tile pixel value
- Parameters
index (tuple(int, int, int)) – Index/row/col of pixel
source (Source) – Subject source of pixel, either sprite or tile
- Returns
Pixel value at index
- Return type
int
-
getColPals
(source)[source]¶ Retrieve sprite/tile color palettes
- Parameters
source (Source) – Subject source of palettes, either sprite or tile
- Returns
Color palettes of target source
- Return type
list
-
getColPalNames
(source)[source]¶ Retrieve sprite/tile color palette names
- Parameters
source (Source) – Subject source of palette names, either sprite or tile
- Returns
Names of target source color palettes
- Return type
list
-
getColPal
(name, source)[source]¶ Retrieve a specific sprite/tile color palette
- Parameters
name (str) – Name of color palette to retrieve
source (Source) – Subject source of palette, either sprite or tile
- Returns
Color palette specified by name
- Return type
list
-
setColor
(name, index, color, source, orig=None)[source]¶ Sets a color in a specific color palette
- Parameters
name (str) – Name of color palette containing target color
index (int) – Index of color in color palette
color (QColor) – New color to be set to
source (Source) – Subject source of target palette, either sprite or tile
orig (QColor, optional) – Original color of the target color, defaults to None
-
previewColor
(name, index, color, source)[source]¶ Previews a color without committing it to the data; used by colorpalette.ColorPreview
- Parameters
name (str) – Name of color palette containing target color
index (int) – Index of color in color palette
color (QColor) – Color to preview
source (Source) – Subject source of target palette, either sprite or tile
-
setColPalName
(cur_name, new_name, source)[source]¶ Set name of a color palette
- Parameters
cur_name (str) – Current name of target color palette
new_name (str) – New name for target palette
source (Source) – Subject source of target palette, either sprite or tile
-
addColPal
(name, source)[source]¶ Add a new color palette
- Parameters
name (str) – Name for the new color palette
source (Source) – Subject source of new palette, either sprite or tile
-
remColPal
(name, source)[source]¶ Remove a color palette
- Parameters
name (str) – Name for the target color palette
source (Source) – Subject source of target palette, either sprite or tile
-
setPixBatch
(batch, source)[source]¶ Sets pixels to new values based on the contents of a set of pixel deltas
- Parameters
batch (defaultdict) – Set of pixel deltas represented by pixel indexes and new values
source ([type]) – Subject source of pixels, either sprite or tile
-
addPixRow
(source)[source]¶ Add a new row of sprites or tiles
- Parameters
source (Source) – Subject source to add the row to, either sprite or tile
-
remPixRow
(source)[source]¶ Remove a row of sprites or tiles
- Parameters
source (Source) – Subject source to remove the row from, either sprite or tile
-
setUndoStack
(undo_stack)[source]¶ Sets the undo stack for the GameData object
- Parameters
undo_stack (QUndoStack) – The undo stack to set
-
classmethod
fromFilename
(file_name, parent=None)[source]¶ Class method to instantiate the GameData object from a JSON file containing project data
- Parameters
file_name (str) – Path to project data JSON file
parent (QWidget, optional) – Parent widget for GameData object, defaults to None
- Returns
Instance of GameData instantiated with data from file
- Return type