Coder Social home page Coder Social logo

snake_and_ladder_godot's Introduction

Godot Toasts

A plugin that allows you to make Android like toast on all platforms

Enable the plugin

Add the addons folder in you project like your would with any other plugin. Go to project settings -> plugins and activate the plugin.

Using the plugin

Wherever you want to use just paste this:

var toast = Toast.new("Toast text", Toast.LENGHT_SHORT)
get_node("/root").add_child(toast)
toast.show()

It is best to make the TOAST a child of the root node so that there are no overlapping problems.
The toast will delete itself after it finished.
There is no purpose to add the Toast from the editor.

Toast

Inherits: Control < CanvasItem < Node < Object

Methods

Toast new(text: String, lenght: ToastLenght, mstyle: ToastStyle = preload( "style_resource/default.tres") )
void show()

Properties

Resource style

Enumerations

enum ToastLenght:
LENGHT_SHORT: the toast will last for 1.5 seconds, including the fading
LENGHT_LONG: the toast will last for 3 seconds, including the fading

Signals

  • done()
    Emitted when the toast has terminated its job and is preparing for deleteing itself.

Property Descriptions

  • Resource style
    Controls the toast aspect. The value is declared as a Resource, even if there is a custom resource because of a Godot limitation. Will be changed in Godot 4.0.(see this)

Methods Descriptions

  • Toast new(text: String, lenght: ToastLenght)
    Returns a new Toast. The text is the text that will be shown inside of the toast. lenght represents the duration lenght. mstyle represents the toast syle stored in style(see propriety descriptions).
  • void show()
    Starts the toast.

ToastStyle

Inherits: Reference < Object

A resource that controls the toast aspect. You can create one in the inspector panel and save it as tres or res. Recomandation: If you select Full Type make corner radius 0;

snake_and_ladder_godot's People

Contributors

abhishekbhangalia avatar

Stargazers

 avatar

Watchers

 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.