Giter Club home page Giter Club logo

godot-editor-icons-previewer's Introduction

Godot Editor Icons Previewer

Godot plugin which adds ability to preview all available icons in Godot Editor. Can be used to facilitate the process of developing neat user interfaces for Godot editor plugins without the need to import any custom icons.

Compatibility

Godot 3.0+ compatible. Note that in version 3.0, there's no menu option, but the plugin is still accesible via a shortcut (see below). For the Godot 4 version, see here : latest version

Usage

To read the full documentation, which will be kept updated as more features come in, read the documentation

Navigate to Project > Tools and click Show Editor Icons menu option (Alt+I shortcut is also available for this):

Show Editor Icons

A window shall popup listing all available editor icons which Godot uses natively (can also show icons from any custom C++ module):

Editor Icons

Hovering on icons will show their internal name to be used when developing plugins. In order to use the icon in your plugins, you can fetch it via code like so:

button.icon = get_icon('Add', 'EditorIcons')

To simplify the process even further, you can also get the above snippet by right-clicking on an icon and it will be copied to your clipboard. Left-clicking just copies the raw icon's name.

Caveats

  1. In some cases, a control might not have a theme inherited from Godot's base control as it can be overriden. For a more sophisticated way on how to get an icon from Godot's base control, see editor_plugin_utils.gd.

  2. The get_icon() method is meant to be used in EditorPlugins. If you really want to use this in plain tool scripts from within the editor, an icon can be fetched with the following snippet:

     tool
     extends Node2D # This can be anything.
    
     func _draw():
         if Engine.editor_hint:
             # Find internal `EditorNode` class.
             var editor_node = get_tree().get_root().get_child(0)
             # Get internal GUI base.
             # This is equivalent to `EditorInterface.get_base_control()`.
             var gui_base = editor_node.get_gui_base()
             # Get icon from the base control.
             var icon_add = gui_base.get_icon("Add", "EditorIcons")
             # Draw the icon.
             draw_texture(icon_add, Vector2())

    This approach may not always work across Godot versions as this relies on internal functionality behind EditorNode.

  3. This won't work for outside the editor.

godot-editor-icons-previewer's People

Contributors

dark-peace avatar upizpp avatar xrayez avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.