Skip to content
A quick and dirty GUI library for Defold.
Lua
Branch: master
Clone or download

Latest commit

JCash Added support for slider control (#11)
* Added support for slider
Latest commit 9ea9b1e May 4, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dirtylarry Added support for slider control (#11) May 4, 2020
doc Added some images and a readme. Jul 16, 2016
input Added dirtylarry from private repo, fixed bugs in input-method. Jul 15, 2016
main Added support for slider control (#11) May 4, 2020
.gitignore Initial commit Jul 13, 2016
README.md Added support for slider control (#11) May 4, 2020
game.project Added some images and a readme. Jul 16, 2016

README.md

dirtylarry logo

dirtylarry

A quick and dirty GUI library for Defold.

Usage

  1. Add latest zip URL as a dependency in your Defold project: https://github.com/andsve/dirtylarry/archive/master.zip

  2. Add one of the supplied GUI template files, located in dirtylarry/*.gui, to your GUI scene.

  3. In your GUI script, add local dirtylarry = require "dirtylarry/dirtylarry" to the top and make sure the script has acquired input focus.

  4. Then add the corresponding function inside your on_input:

    • dirtylarry/input.gui:
    dirtylarry:input("node_id", action_id, action, gui.KEYBOARD_TYPE_DEFAULT, "Default text")
    • dirtylarry/button.gui:
    dirtylarry:button("node_id", action_id, action, function ()
        print("button was pressed")
    end)
    • dirtylarry/checkbox*.gui:
    self.checkbox_value = dirtylarry:checkbox("node_id", action_id, action, self.checkbox_value)
    • dirtylarry/radio*.gui:
    self.radio_value = dirtylarry:radio("node_a_id", action_id, action, "a", self.radio_value)
    self.radio_value = dirtylarry:radio("node_b_id", action_id, action, "b", self.radio_value)
    • dirtylarry/slider.gui
    self.slider_value = dirtylarry:slider("slider", action_id, action, -1.0, 1.0, self.slider_value)
  5. In the input/game.input_binding, add the following triggers:

    • Key Triggers: Input: key-backspace, Action: backspace
    • Mouse Triggers: Input: mouse-button-1, Action: touch
    • Text Triggers: Input: text, Action: text
    • Text Triggers: Input: marked-text, Action: marked_text

For more usage examples take a look at main/examples.gui_script and dirtylarry/dirtylarry.lua for configurational options.

Examples

  • Using the built in font: Example project with Defold default font
  • Using Input font: Example project with Input font
You can’t perform that action at this time.