* Add preferences for tile mode basis vectors
Each tile is offset according to the x and y basis. For example, a tile (1,1) would be at basis_x + basis_y
* Update tools for custom tile modes
Show the indicator in the correct position, and only draw on the nearest tile.
* Fix style issues
* Move tile functionality to own class to prevent bloating Project
* Fix error in Tiles bounding box logic
* Make tile mode offsets project settings
Since the desired tile mode offsets depends on the tile being drawn, the tile mode offsets should be a project specific setting which is persisted in the project file.
* Update TileMode object immediately after closing dialog
* Don't draw center tile by default in TileMode
* Move tile mode offsets to view menu
* Move tile mode offsets dialog out of ImageEffects
Mapped to left and right mouse buttons respectively by default, as well was L1 and R1 buttons respectively in joypads. This commit should allow mouse-free drawing, since it's now possible to activate the left and right tools via joypad and keyboard buttons, thanks to the Keychain plugin.
Similar to GraphicsGale, you can now draw without moving the mouse. Although you still need the mouse for the left and right buttons, but I'd like to make give more options to the user as well so that they can activate tools using keyboard and joypad buttons, if they like.
The numpad arrow keys did nothing previously, so nothing changes for people who are not interested in this feature. They are also configurable thanks to the Keychain plugin.
* Start implementing the godot_better_input plugin
* Update ShortcutEdit.gd
* Load & save preset option
* Add some groups and fix action events not being deleted on load
* Add MenuInputAction class for multiple menu accelerators
* Create a proper plugin and a BetterInput autoload
* Update menu accelerators
* Move settings to BetterInput
* Move menu enums to Global, make more MenuInputActions
* Add more menu events
* Add new groups
* Optimize BetterInput _input() method
* Remove a lot of lines of code
* Change some previous events, add ignore actions and a View menu group
* Change update_item_accelerator to update_ui
* Move MenuInputAction initialization to BetterInput.gd
* Update hint tooltips when a shortcut changes
Temporarily comment out some code regarding the configurable modifiers
* Some MenuInputAction variable name changes
* Add handle_input() to InputAction
* Update the shortcuts of buttons
* Fix shortcut selector menu position
* Change plugin name into Keychain
* Fix keyboard input dialog exiting when Enter or Space is being pressed
* Add two more groups
* Make groups folded by default
* Temporarily make tool modifier shortcuts not configurable
A temporary change, they will be made configurable again, with different actions that are currently mapped to the same events, local/independent from each other.
* Add license for Keychain
* Fix issue where a key event would be added in other input types
* Fix bug where the assigned state was not updated when the dialog appeared again
* Update Main.tscn
* Add a disabled line edit in keyboard shortcut selector to grab focus
* Load presets in the Keychain autoload
This way, the input actions get updated from the start, instead of only at the ShortcutEdit scene.
WARNING, this currently causes crashes if the menu items have no shortcut binded to them.
* Move custom settings away from Keychain.gd
To keep it the same as the upstream plugin
* Change menu enum names
* Made action_get_first_key() more general
* Use arrays for menu items instead of dictionaries, fixes crash
* Move moveable panels to Window menu
* Format
* Optimize hint tooltip updating
* Add support for translations in Keychain
* Translation changes
* Made tool modifiers configurable
Needs more testing.
* Made camera arrow key movement configurable & joypad axis support
This commit removes the ability to press Shift and Control+Shift to adjust the camera arrow key movement speed. Instead, the speed depends on the zoom level.
The right joypad analog stick is configured to move the camera by default.
* Rename presets into shortcut profiles, use Resources and let users create their own
* [skip ci] Update addons README
* Update Global.gd
* add limit change with brush
* Delete Draw.gd
* Delete BaseTool.gd
* Added all shortcuts
* formatting
* Removed 1 shortcut from "Fullscreen"
* Assigned shortcuts to special behaviours
* formatting
* Added configurable shortcuts to special behaviour
* formatting
* Added special behaviour shortcuts and some code im
provements
* a minor fix
* Add dockable container plugin
Experimenting with it, also added a tabs_visible property to the DockableContainer. Removed some code about Tallscreen from Main.gd, but not all of it.
* Add a panel behind the UI, temporarily restore the dark theme
* Remove tallscreen code
* Add edit mode, toggles DockableContainer's tab visibility on and off
* Split tool options into color pickers, left and right tool options
* Remove alternate_transparent_background
* Re-order tool buttons on resize
* Clip content in timeline
* Changes to the tool panel
* Removed some old unused node variables
* Restore Zen mode
* Set tabs_visible = false by default
* Better way to set tabs_visible = false by default
* Added the license of godot-dockable-container
* Remove unneeded lines
* Update README.md
* Restore window transparency with the canvas
It makes all of the TabContainers transparent however, which may not be what we actually want.
* Change tab names of the UI elements
* Remove unneeded nodes from ColorPickers.tscn
* Update default.tres
* Let the user hide elements individually
* Add some checks in HandleThemes
* Center tool icons
* Remove unneeded custom panel in SplashDialog
* Bump version to v0.10-dev and some other minor changes
* Fix crash on Zen Mode
* Added a hacky way to fix the issue with the palette panel size
* Add support for creating Ubuntu Touch click packages.
The clickable directory contains the files necessary to create a
click package designed for Ubuntu Touch, a community-driven Linux
distro for mobile phones as an alternative to iOS and Android.
A new CI script has been added to create the packages, which is
copied over from one of my other projects. Please change this to
suit your needs.
A new custom feature "clickable" has been added to the project
settings to allow customizations for the Ubuntu Touch platform.
Signed-off-by: Marquis Kurt <software@marquiskurt.net>
* Make clickable CI follow more closely to desktop builds
* Remove sudo from clickable install step
* Install software-properties-common
* Comment out docker startups in click install
* Change export name for Click version
* Change name and export mode to pack only
* Change means of copying data to clickable dir
* Install sudo to docker
* Add -g to docker add user
* Remove docker user creation
* Remove other chpasswd stuff
* Split CI into two jobs
* Make build-ubports.sh runnable
* Use HiPDI GUI theme on Clickable
* Move clickable folder to Misc, add release CI targets
* Add mobile to clickable settings
* Add pixelorama_data to install data
* Create pixelorama_data subdir in click itself
* Change default save dir for clickable
* Update AppArmor policy
* Update clickable version to test AppArmor
* Revert changes and use user data dir
* Add README pertaining to Ubuntu Touch
* Remove GODOT_MAC_VERSION from UT port workflow
Co-authored-by: Manolis Papadeas <35376950+OverloadedOrama@users.noreply.github.com>
Cursor icon is temporary. It works by clicking multiple times on the places you want to create edges, and to complete the polygon you either have to click at the first edge (if you hover the mouse, a circle appears in that position), or you can auto-fill by double clicking.
Icons most likely temporary. A bit problematic when the selection is in negative coords and the preview does not work well with mirroring and mirror view. Same is true for the shape tools.
When the user clicks on a pixel, all pixels of the same color are being selected. Shift adds to the selection, Ctrl subtracts. The icon and the hint tooltip are temporary.
* Basic move tool
* Added marching ants effect on the selection borders
* Rename SelectionRectangle to SelectionShape, make it have non-rectangular shape and multiple SelectionShapes can exist
- Create multiple selection rectangles
- Merge them together if they intersect
- Move the selections (without contents as of right now)
- Gizmos are being drawn but they are not functional yet
Code is very ugly.
* Sort vectors counter-clockwise to be used as polygon borders
I did this, no idea if it works properly, probably won't be used but I thought I'd keep it saved somewhere
* More experiments I may or may not need
Trying to generate a polygon from the individual selected pixels
* Change default rectangle select behavior and ability to clip polygons using Control
* Fix rectangle selection clipping
* Split polygon into two with selection subtracting
* Move selection with contents with the move tool
Code is still a mess, don't bother looking.
* Move some methods from SelectionShape.gd to Selection.gd
The purpose of this is to generalize some selection code, so that it applies to all polygons, the entire selection. More will follow.
* UndoRedo for border moving
Nothing else in the selections system works properly in UndoRedo right now. Needs:
- UR support for creating selections
- UR support for modifying selections (merging and cutting selections together)
- UR support for removing selection
- UR support for moving content
& for all the rest of the remaining features
* Moving all of the selection shape logic to Selection.gd
Handle all of the polygons there instead of having them as individual nodes. Should be easier to handle undo/redo this way. This commit probably breaks move tool + selection tool and undo/redo. Code is still a mess. For your sanity, I hope you are not reading this. I promise I will clean up.
* Move tool works again
Buggy and messy, of course.
* Remove unneeded code and restore selection move undoredo logic
* Made Selection.gd have one big preview_image for when moving content, instead of each polygon having its own image
Could be further optimized for some specific cases. We could also remove selected_pixels from SelectionPolygon.
* UndoRedo support for creating, deleting, merging and clipping selections
UndoRedo support for moving content not added in this commit. Should work but needs more testing. This PR also removes selected_pixels from the SelectionPolygon class.
* Confirm & cancel selection movement, should support undoredo properly too
Press Enter or do any editing to confirm movement, Escape to cancel. I will most likely add UI buttons for confirm and cancel too.
* Mirror View affects selection
* Restore Cut, Copy, Paste and Clear Selection
Pasting now no longer requires a pre-existing selection and instead copies the selections themselves too.
* Created a new Select menu, which has Select All and Clear Selection as options
Clear Selection now also confirms content moving. TopMenuContainer code has changed to no longer rely on Global for the menu buttons.
* Draw gizmos as rectangles
No functionality yet. They may need to be turned to nodes, so that they can easily resize based on zoom level and check for mouse enter/exit events.
* Made gizmos get drawn in the sides and corners of the big bounding rectangle instead of individual selection parts
Still no functionality yet.
* Restore label text
* Minor optimization when clipping selections
This will execute the for loop less times
* Made a Gizmo class, cursor change on hover, has_focus = false on mouse click
Now I should actually make them resize when dragged, aye?
* Very basic gizmo resizing, still a WIP, does not work properly yet
* Start replacing the array of selected pixels with a BitMap
This should optimize the selection making a lot, and it also allows for easy border drawing without having to deal with polygons, thanks to the MarchingAntsOutline.shader
Still commit is still a WIP, image effects and brushes may not work properly yet.
Because the BitMap has a fixed size, the size of the project, moving the selection outside of canvas boundaries has proven to be a bit tricky. I did implement a hacky way of handling it, but it may be buggy and problematic. I'm still unsure whether this is the best way to handle the situation.
* Selection works with mirror view
* Draw a black rectangle when the user is making a rectangular selection
After they release the mouse, the black rectangle becomes the selection
* Make Selection.gd update when undoing/redoing
* Fix brushes not working properly with non-rectangular selections
* Added invert selection
* Cache has_selection as a variable for a speedup
* Fix conflict issues with the shape tools
* Made the bitmap image squared so the marching ants effect will be the same on both dimensions
There may be a better way to fix the issue, perhaps inside the shader itself.
* Some optimizations to call selection_bitmap_changed() less times
* Restored almost all of the image effects
Left to do:
- Change gradient's behavior. Unsure of how it will work with non-rectangular selections yet, but it should not generate pixels outside of the selection.
- Restore rotation
- Resize bitmap on image resize
- Remove the `pixels` array from the ImageEffect
* Fix Selection.gd not updating when changing project
* Resize the selection bitmap along with image resize
* Restored rotation's old behavior and finally got rid of the selected_pixels array
The rotation does not yet work properly with selections, but at least it now "works".
* Resize selection too when using gizmos
Left to do for gizmos:
- Proper cancel transformation
- Begin transformation
(currently named move_content_start but it should be renamed to something more general) when resizing gizmos
- Keep the original image and selection in memory and resize them. Meaning, gizmos should not resize the already resized data, but only resize the original. This is less destructive as there is no danger of data loss.
- Always resize on InputEventMouseMotion. This is going to be worse for performance, but it will look better for the user.
* Image and bitmap resizing now uses the original data and begin transformation on gizmo click
No matter how many times the user resizes on the current transformation, the original data will not be lost until they either confirm or cancel, so there is no data loss before confirmation/cancel.
* Cancel transformation now works properly when the selection has been resized
* Made gizmos resize on mouse motion, fix issues with negative bounding rectangle and when combined with the move tool
* Resizing can now get out of positive bounds, clearing and inverting now gets limited to the canvas bounds
Resizing currently does not work properly with negative (left & up) canvas boundaries
* Flip image when resizing and the bounding rectangle gets flipped
* Call move_content_confirm() when inverting selection
* Attempt to implement selection resizing that goes outside of the canvas boundaries (not working properly yet)
* Flip selection when resizing to negative bounding rectangle sizes
And fix preview_image vertical flipping
* Fix rotation so that it works (almost) properly with selections
Rotation algorithms now accept and only work with a given image, and the pivot has been added as a parameter
* Experimental gizmo rotation - does not work properly yet
Transforming the selection outside of the canvas is still broken.
* Fix some issues with moving selection out of canvas bounds
* Fix more issues with selection getting resized outside of canvas bounds
* Update marching ants effect properly when switching between projects
And make sure the frequency of the marching ants effect always looks roughly the same on all project sizes
* Made the rotation gizmo part of the gizmos array and resize them based on camera zoom
* Remove unneeded parameter from move_bitmap_values()
* Remove more unneeded parameters
* Move the selection only if the cursor is above it and neither shift nor control are currently pressed
* Gradient generation now works on non-rectangular selections
Although this behavior might not be the intended one
* Copy/paste marching ants effect offset
Useful for when the selection is in negative coords
* Fix issue with clear selection & UndoRedo
* Restore the ability to move selection when it's in negative coords
* Made the marching ants offset a Project variable
This fixes the issue of project switching and keeping the previous project's offset. Again, this is only relevant for when the selection is in negative coords.
* Made the "from current selection" palette preset work with the new selection system
* Fix out of bounds error when using the rectangular select tool on negative coords
* Some code cleanup
* Comment out the rotation gizmo for now, since it does not work properly
* Update marching ants shader params and gizmo sizes when the bitmap changes
* Move some methods around in Selection.gd
* Replace old palette system with a new one
* Replace default json palettes with new resource versions
* Add missing translation strings
* Fix Erevoid's issues 2, 3 and 4
* Rewrite palette grid to improve performance
Add middle click scrolling
* Fix index conversion functions
* Fix palettes editing by copying them to XDG user write path
* Add Windows specific fixes
* Add import support for old json palette format
* Add create/edit palette settings check.
Hide add/delete color buttons when no palette is displayed.
* allowed and enabled per_pixel_transparency
* Added a Transparency menu
* Added an Alternate screen for transparency
* Added transparency methods
Added the transparency methods plus modified fullscreen such that it resets transparency on toggling hence, Removing the issue of blackness
* Modified the shader to allow transparency
* Added a material to ViewportContainer
Fixed the bug that darkens image when decreasing opacity
* Update Global.gd
* Update Main.gd
* Update TopMenuContainer.gd
The lock aspect ratio button has been changed from a checkbox to a texture button and the template code has been refactored to use a Template class instead of enums. Only dark icons have been added for now.
* Draw grid only over the Canvas (when in tiling mode)
* Replace some magic numbers with enums.
It's too easy to break something when adding something new in here. Should be a little harder now.
* Added Pixel Grid.
- Pixel grid is shown only when it's enabled and camera is zoomed close enough.
- Settings: pixel_grid_show_at_zoom (as a percentage because that's what's shown in the settings panel), pixel_grid_color. Default values might need changing.
- To distinguish between grid and pixel grid default settings for grid width, grid height are changed.
- Now both grid and pixel grid are drawn above (after) tile mode. Grid is drawn above (after) pixel grid.
* Improved tiling feature
* Removed some unwanted code
* Fixed the bug mentioned by overloaded
* Added the requests by overload
* changed the y value which was given x value before
It now first attempts to serialize the project data and turn them to JSON, and then opens the file. This is a lto safer because, if a crash happens in the serialization, the file is not already open, and therefore it does not get corrupt. Earlier, if a crash happened, the file would be empty. This meant that if that file existed previously, all of the data would be lost.
This will be the parent of all (or most) image effect dialog nodes. Currently only parent on FlipImageDialog, will change to be parent of the rest of the effects.
This prevents Godot from appearing as an application playing sound
while Pixelorama is running. This also decreases CPU usage
(especially on macOS due to a known engine bug).
* Split export code from export dialog to Export.gd autoload
Clean access to child nodes of export dialog
* Fix export variables set in Main.gd
* Fix more wrong variable assignments
Co-authored-by: alexhayoo <65853178+alexhayoo@users.noreply.github.com>
Two special guides - one horizontal and one vertical - that let you change the axis of symmetry for mirroring. On the next commit(s) I will make them visible only if mirroring is toggled on. Almost solves #133
* Refactoring tools
* Remove unused code
* Fixed some inferring errors and added translations
* Attempt to fix some Script Errors found in the CI workflow
* Fix bucket crash.
* Fix static type convert.
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
The "Open" option will handle importing of .pxo files and image files from now on. The "ImportSprites" file dialog node and script are scheduled to be deleted too. Importing spritesheets option will return soon. Next thing I'm going to work on is a preview window that will appear when importing image files.
A Project class contains project-specific data like name, undo_redo, frames, layers, tags and brushes. These variables have been moved from Global. This is the first step towards multiple tab support, where each tab will be a different Project.
The Canvas is now single node, instead of having multiple canvases for each frame. This should also be a performance optimization, since there are less canvas nodes, so there are less _input() calls. It should also fix a rare Undo/Redo issue with motion drawing and making lines. Could be unstable, needs more testing.
As a side effect, the guides are now the same for all frames, so this should also close #246.
Replaces nested Global.animation_tags arrays. Also replaced array.duplicate(true) with looping through the array and creating a new class for each array element, because duplicate(true) does not create new classes, unfortunately, which was causing issues with undo/redo.
Moved code from Global.gd and Canvas.gd to DrawingAlgos.gd. Will also move the fill_gaps and draw_brush methods of Canvas.gd next. Maybe even refactor the inside of them a bit to make them easier to read.
The old way weren't causing any issues, but it would have caused with double-digit version numbers. Also fixed backwards compatibility issue with 0.6.2 and previous versions.
Pixelorama now requires at least Godot 3.1.2 or 3.2.x to work, because TranslationServer.get_loaded_locales() was not included in older versions. If you're using an older version of Godot, please update. Godot 3.2.1 is the currently recommended version, until 3.2.2 is out.
Also updated the list of the translators.
Moved all the relative assets there, including the icon files which no longer are on the res:// folder. The main page of the repository should look much cleaner now.
Made a new "src" folder that will contain the source code files, like all the GDScript and scene files. Please read this for more details: https://www.gdquest.com/docs/guidelines/best-practices/godot-gdscript/
It made no sense to keep scenes separate from their scripts. More file organizing will follow soon.
You currently cannot change the bindings of the timeline buttons, but now that they are in the input map, it should prevent the shortcuts from being bound elsewhere.
This results in slightly increased performance and decreased
CPU/GPU usage.
This also prevents the "Directional shadow buffer status invalid" error
message from appearing in the console output when using a very old
graphics card.
- If the palette has colors, automatically select the first one
- When adding a new color button, take the color currently selected on the picker instead of white
- Fixes issues with drag&dropping color buttons. The color that was dragged remains selected.
Added a slider under the layer add/remove/etc buttons that changes the currently selected layer's transparency. It gets saved in .png and .pxo files, while respecting non-opaque pixels in the image too. Which means, their alpha values aren't being overwritten.