All Projects → BlueBoxWare → Libgdxplugin

BlueBoxWare / Libgdxplugin

Licence: apache-2.0
An IntelliJ plugin for use with LibGDX

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to Libgdxplugin

Intellij Haskell
IntelliJ plugin for Haskell
Stars: ✭ 1,169 (+953.15%)
Mutual labels:  intellij-plugin
Mario Game
🍄 Super Mario Bros 16-bit version clone. Written in Java and using the LibGdx game engine.
Stars: ✭ 95 (-14.41%)
Mutual labels:  libgdx
Flutter Intellij
Flutter Plugin for IntelliJ
Stars: ✭ 1,635 (+1372.97%)
Mutual labels:  intellij-plugin
Phpinspectionsea
A Static Code Analyzer for PHP (a PhpStorm/Idea Plugin)
Stars: ✭ 1,211 (+990.99%)
Mutual labels:  intellij-plugin
Intellij Touch
MacBook Touchbar support in IntelliJ
Stars: ✭ 92 (-17.12%)
Mutual labels:  intellij-plugin
Gradle Changelog Plugin
Plugin for parsing and managing the Changelog in a "keep a changelog" style.
Stars: ✭ 102 (-8.11%)
Mutual labels:  intellij-plugin
Json2java4idea
A JSON to Java conversion plugin for Intellij IDEA and AndroidStudio.
Stars: ✭ 69 (-37.84%)
Mutual labels:  intellij-plugin
Libgdx Ingameconsole
A LibGdx library that allows a developer to add a console (similar to how it is featured in Source games) to their game.
Stars: ✭ 108 (-2.7%)
Mutual labels:  libgdx
Gdx Gamesvcs
Easy integration of gameservices in your libGDX game: Google Play Games, Apple Game Center, Amazon GameCircle and more
Stars: ✭ 92 (-17.12%)
Mutual labels:  libgdx
Intellij Elixir
Elixir plugin for JetBrain's IntelliJ Platform (including Rubymine)
Stars: ✭ 1,488 (+1240.54%)
Mutual labels:  intellij-plugin
Intellij Gdscript
Godot Engine and GDScript support plugin for IntelliJ based IDEs
Stars: ✭ 83 (-25.23%)
Mutual labels:  intellij-plugin
Intellij Emmylua
Lua IDE/Debugger Plugin for IntelliJ IDEA
Stars: ✭ 1,311 (+1081.08%)
Mutual labels:  intellij-plugin
Gdx Vfx
LibGDX post-processing visual effects
Stars: ✭ 105 (-5.41%)
Mutual labels:  libgdx
Intellij Plugin Golangci Lint
GolangCI-Lint integration for IDEA
Stars: ✭ 74 (-33.33%)
Mutual labels:  intellij-plugin
Finisterra
Java game client and server based on the popular argentina MMORPG Argentum Online
Stars: ✭ 107 (-3.6%)
Mutual labels:  libgdx
Robot Plugin
Robot Framework support plugin for IntelliJ Idea
Stars: ✭ 70 (-36.94%)
Mutual labels:  intellij-plugin
Restfultoolkit
A Toolkit for RESTful services development.
Stars: ✭ 101 (-9.01%)
Mutual labels:  intellij-plugin
Unlucky
Java LibGDX Android 2D RPG Game
Stars: ✭ 111 (+0%)
Mutual labels:  libgdx
Kotlin
The Kotlin Programming Language.
Stars: ✭ 39,664 (+35633.33%)
Mutual labels:  intellij-plugin
Mybatiscodehelper Pro
brucege.com
Stars: ✭ 1,565 (+1309.91%)
Mutual labels:  intellij-plugin

Current version Downloads

This unofficial plugin adds a number of libGDX related features and tools to IntelliJ and Android Studio.

Installation

In IntelliJ or Android Studio go to Settings -> Plugins -> Browse repositories... and search for "libGDX".

Alternatively: download the zip from the Jetbrains Plugin Repository, go to Settings -> Plugins -> Install plugin from disk and select the zip you downloaded.

This plugin needs a recent version of the official Kotlin plugin (even if you only use Java), so please make sure to enable (and if necessary update) that plugin first. To update the Kotlin plugin to the newest version, go to: Tools -> Kotlin -> Configure Kotlin Plugin Updates -> Check for updates now.

Features

Inspections

libGDXPlugin adds several inspections, which look for possible issues in a project. Code inspections support both Java and Kotlin. To disable or enable inspections go to Settings -> Editor -> Inspections -> libGDX. See Inspections.md for an up to date list.

Color previews

When using a libGDX color in Java or Kotlin code (e.g. Color.BLUE or Color.valueOf("#0000ff")) a preview of the the color is shown in the left gutter. Color previews are also shown in the editor when editing Skin files and in the Debug Tool Window.

To disable color previews, go to Settings -> Editor -> libGDXPlugin.

Skin JSON support

Files with the extension .skin are treated as Skin JSON files. For files with the extension .json which look like Skin files, you are asked whether they should be treated as Skin files (this can be turned off in the settings). You can also mark and unmark files as Skin files using the context menu of a file.

For files which are marked as Skin files, the plugin provides additional Skin related support, including

  • Syntax highlighting (can be configured using Settings -> Editor -> Colors & Fonts -> libGDX Skin)
  • Color previews in the left gutter. Click on a color preview to open a color selector dialog
  • Structure View
  • Code completion for class names, property names, property values and, if an .atlas file with the same name as the Skin and in the same directory exists, drawable/texture names
  • Folding
  • Formatting/Code Style (Code Style can be configured using Settings -> Editor -> Code Style -> libGDX Skin)
  • Warnings when using classes which don't exist, using inner classes which are not static, using properties which don't correspond to a field in a given class or using malformed color strings
  • Find usages of a defined resources within the Skin file
  • Crtl-B (⌘+B): navigate from the usage of a resource to it's definition
  • Crtl-B (⌘+B) with the caret on a class or field name: navigate to the source of the class or field
  • Crtl-B (⌘+B) on a bitmap font name: navigate to the corresponding bitmap font file
  • Renaming a resource with Shift-F6 also renames it's usages in the Skin files [1]
  • (Un)commenting blocks of code with Ctrl-/
  • Smart Enter
  • With Shift pressed, hover over a Drawable/Texture name to view a preview of the Drawable
  • Use Code -> Generate or Alt-Ins (Cmd-N) to create a new color using a color pick dialog
  • QuickFixes to create missing resources and convert colors between hex and floats
  • Several inspections to highlight problems and possible issues
  • Breadcrumbs

[1]: Usages of the resource in Java/Kotlin code are not automatically renamed, expect when using the @GDXAssets annotation (see below)

JSON support

IntelliJ doesn't work well with libGDX-style JSON, which is more forgiving when it comes to things like unquoted strings and missing comma's. libGDXPlugin adds support for libGDX's custom JSON with the usual niceties of syntax coloring, completion, folding, etc.

To have libGDXPlugin treat a JSON file as a libGDX-style JSON file: in the Project Window, open the context menu for the file and select Mark as libGDX style JSON.

Atlas file support

Files with an .atlas or .pack extension are treated as Texture Atlas packfiles.

Atlas file support includes:

  • Highlighting
  • Structure View
  • Folding
  • With Shift pressed, hover over a Region to view a preview of the image

Bitmap Font file support

Files with a .fnt extension are treated as Bitmap Font Files, with:

  • Highlighting
  • Structure View
  • Folding

Skin resources and Atlas region names in Java and Kotlin code

To get code completion, Go to Definition, Find Usages, Rename Refactoring, Diagnostics and Image previews for:

  • Skin resource names
  • Region names from Atlas files in Skin.get*() and TextureAtlas.get*()
  • Property keys in I18NBundle.get() and I18NBundle.format()

and related methods, use the @GDXAssets annotation to tell libGDXPlugin which files to use.

First add the annotation to your build. In build.gradle:

repositories {
    // ...
    jcenter()
}

dependencies {
    // ...
    compile 'com.gmail.blueboxware:libgdxpluginannotations:1.16'
}

Then annotate Java fields and Kotlin properties where appropriate. Specify file names relative to the Project Root.

Java:

        @GDXAssets(skinFiles = {"android/assets/ui.skin"})
        // or Windows style: @GDXAssets(skinFiles = {"android\\assets\\ui.skin"})
        Skin uiSkin = new Skin(Gdx.files.internal("ui.skin"));

        @GDXAssets(
                skinFiles = {"assets/default.skin", "assets/main.skin"},
                atlasFiles = {"assets/images.atlas"}
        )
        Skin skin = new Skin();
        skin.load(DEFAULT_SKIN);
        skin.load(MAIN_SKIN);
        skin.addRegions(ATLAS);

        @GDXAssets(atlasFiles = {"assets/images/images.pack"})
        TextureAtlas atlas = new TextureAtlas(Gdx.files.internal("images/images.pack"));

        @GDXAssets(propertiesFile = {"assets/18n/Messages.properties"}) // Specify the base file, including .properties extension
        I18NBundle bundle = I18NBundle.createBundle(Gdx.files.internal("i18n/Messages"));

Kotlin:

    @GDXAssets(skinFiles = ["android/assets/ui.skin"])
    // or Windows style: @GDXAssets(skinFiles = ["android\\assets\\ui.skin"])
    val uiSkin = Skin(Gdx.files.internal("ui.skin"))

    @GDXAssets(
            skinFiles = ["assets/default.skin", "assets/main.skin"],
            atlasFiles = ["assets/textures.atlas"]
    )
    val skin = Skin()
    skin.load(DEFAULT_SKIN)
    skin.load(MAIN_SKIN)
    skin.addRegions(ATLAS)

    @GDXAssets(atlasFiles = ["assets/images/images.pack"])
    val atlas: TextureAtlas = TextureAtlas(Gdx.files.internal("images/images.pack"))

NOTES

  • Specify file names relative to the Project Root
  • Multiple files can be specified for both the skinFiles, atlasFiles and propertiesFiles parameters
  • When no atlasFiles are specified and a file with the same name as the specified Skin file and the ".atlas" extension exist, that file is used as Atlas file (just like the Skin class itself does). This also works if you specify multiple Skin files.
  • Go To Definition and Find Usages are only available if the specified files are registered as Skin or Atlas file, not when they are registered as JSON or Plain Text files.

@GDXTag and short names in skins

Since version 1.9.9 libGDX skins support tagged classes: the ability to use short names for names of classes in Skin files. In addition to the standard, "built-in" short class names it is also possible to define custom short names for your own classes by overriding Skin.getJsonLoader() and calling Json.addClassTag().

libGDXPlugin understands the default short names. It also tries to determine any custom short names by looking for calls to addClassTag(), but there is only so much it can do.

To explicitly tell the plugin to recognize one (or more) short names for one of your own classes, you can use the @GDXTag annotation on that class.

package com.something.ui;

@GDXTag({"Widget"})
class MyCustomWidget {
  // ...
}

After this, the plugin will recognize Widget as a short name for com.something.ui.MyCustomWidget in Skin files. It is of course still up to you to make libGDX recognize this short name by subclassing Skin or by some other means.

Note that at the moment there is no way to tell the plugin a short name is only valid in specific Skin files, instead of all Skin files.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].