Code Monkey home page Code Monkey logo

godottie's Introduction

GodotTIE

A simple Text Interface Engine to control text output (like in a RPG dialogue) for Godot.

The "Cave-Story" font was created by enigmansmp1824; it's CC-BY-SA licensed, and can be found in https://fontlibrary.org/pt/font/cave-story.

A simple demonstration video: https://www.youtube.com/watch?v=fkd-nIIPxVw

Compatibility

This is the Godot v3.x version of the plugin; for Godot v2.x compatibility, check the Godot_v2.x branch.

Features:

  • Control the velocity in which the text is going to be displayed! (Even text dialogues can have emotions!)
  • Adjust visually the Interface size, so it can fit it in any Dialogue box you want! The script will handle the maximum number of lines and characters!
  • Buffer texts, inputs, and breaks in the Dialogue, with easy to use methods!
  • Control the Dialogue flow from the outside with the available user signals!
  • Use tags on specific parts of your text! (In a RPG, you may want to show specific animations during certain parts of the dialogue; e.g. a "!" question mark popup in the head of a character in one of the moments of the dialogue)
  • User scroll friendly; Log all the text printed; auto-clip words; and more!

Take a look at the 'public' methods in the script and the export variables available; it should give you a hint about the stuff you can easily customize in the engine!

Installation:

You'll need the Godot Engine to do this.

To use GodotTIE as an Addon:

  1. Copy the "addons" folder to your project.
  2. Enable GodotTIE addon on "Project Settings".
  3. Instance a TextInterfaceEngine node to your scene.

Done!

Updates:

  • 17/05/20:
    • Merged jacopofar pull-request: Allow arbitraty Unicode I/O
    • Merged aaronfranke pull-request: Update gitignore
    • Rearrenged files so it's easier to download the plugin from Godot AssetLib.
  • 13/03/18:
    • Merged dalton5000 pull-request: Added Godot 3.x compatibility!
    • Added new branch for Godot 2.x version of the addon.
  • 10/10/17:
    • Corrected Issue of last lines not appearing on very large texts.
  • 10/05/17:
    • Merged radicaled pull-request: Added "buff_clear" as a new buff to reset the text.
  • 30/04/17:
    • Merged radicaled pull-request: Changed add_user_signal to signal keyword.
  • 08/12/16:
    • Font-overriding bug (max_lines) corrected by David Paiva!
    • Since Addons on Godot are gold since v.2.0, I deleted the old GodotTIE folder to make the addon easier to understand and install - also updated the project Icon and scene file.
  • 26/11/16:
    • Corrected bug with "set_buff_speed". Thanks David Paiva!
  • 26/02/16:
    • Changed the "buffs" to dictionaries, to increase readability.
    • Fixed bug with "tag" signals (should only call it once).
  • 25/02/16:
    • Setup of the finished project on GitHub.

License:

MIT License.

godottie's People

Contributors

aaronfranke avatar dalton5000 avatar henriquelalves avatar jacopofar avatar radicaled avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

godottie's Issues

GodotTIE does not work in Godot 3 (WAS: Parse error after enabling GodotTIE in Project Settings->Plugins)

Using release Godot 3.0 Mono build on macOS Sierra

After copying in the addons/GodotTIE directory and enabling in Project Settings, I see the following message in the output:

 res://addons/GodotTIE/text_interface_engine.gd:75 - Parse Error: Expected identifier for argument.
 modules/gdscript/gdscript.cpp:583 - Method/Function Failed, returning: ERR_PARSE_ERROR

Which is strange, because that line looks fine to me. Any thoughts?

Thanks.

Visible scrollbar?

Hi,
is it possible to somehow get a side scrollbar that can be used with the mouse?
Currently I can get the storyline but the navigation is with the Arrow keys.

Euv2qGaiJV

Theme applied in editor, but not in game

Setting custom borders or applying theme does not add a background/borders to the node when running the game, but it shows in editor. Font settings are applied just fine. Is there a special technique to this?
TIE is fantastic, by the way.

label creation doesn't fill out parent node

My text keeps scrolling down instead of to the side, because when the label is created, it doesn't fill out the parent, it just creates a tiny label.

Not sure if this is new godot functionality that broke something, or i'm just not setting it up correctly. might need to add some code to tell the label to fill out it's parent?

Support Rich Text Label [Feature Request]

More of a feature request, but it'd be nice if this had Rich Text Label support.
Tried forking it myself, but a lot of logic fails with rich text label because of how number of lines are determined in auto wrap between label and rich text label.

TIE tutorial?

Not quite a issue, but... Are there any thorough tutorial on TIE? I get lost trying yo decipher how it works.
I really love the per-page presentation in the DEMO_Ipsum and got some ideas for it. Can I go back instead of only forward? Can the font be changued, scaled?

Thx.

[Feature request] Add support for actions and other input types

Working with scancodes makes it much harder to have configurable input, so being able to use actions would be helpful.
InputEventKey provides the function (from the base class InputEvent) is_action(String action) that could be checked instead of checking solely the scancode.

Proposal

Exports

Export an enum to determine whether actions, scancodes, or both should be used to check input. If more input types are to be added, booleans for each type should replace this. Note also that instead of the break scancode being a private variable, it will be exported in this proposal, along with the action.

The keys for scrolling + accepting input text will also be added as exports.

enum INPUT_TYPES {
	ACTION,
	SCANCODE,
	ACTION_OR_SCANCODE,
}
export(INPUT_TYPES) var INPUT_TYPE = INPUT_TYPES.ACTION_OR_SCANCODE

export(int) var BREAK_SCANCODE = KEY_ENTER
export(String) var BREAK_ACTION = "ui_accept"

export(int) var UP_SCANCODE = KEY_UP
export(String) var UP_ACTION = "ui_up"

export(int) var DOWN_SCANCODE = KEY_DOWN
export(String) var DOWN_ACTION = "ui_down"

export(int) var ACCEPT_SCANCODE = KEY_ENTER
export(String) var ACCEPT_ACTION = "ui_accept"

Helper functions

Add a function to check if the event corresponds to the action/scancode while also taking into consideration the INPUT_TYPE selected.

2 helper functions will be added to more concisely check if the INPUT_TYPE includes action or scancode.

func _is_input_type_action() -> bool:
	return INPUT_TYPE == INPUT_TYPES.ACTION or INPUT_TYPE == INPUT_TYPES.ACTION_OR_SCANCODE

func _is_input_type_scancode() -> bool:
	return INPUT_TYPE == INPUT_TYPES.SCANCODE or INPUT_TYPE == INPUT_TYPES.ACTION_OR_SCANCODE

func _is_input_active(event: InputEventKey, scancode: int, action: String) -> bool:
	return event.pressed and (
		(_is_input_type_action() and event.is_action(action))
		or (_is_input_type_scancode() and event.scancode == scancode)
	)

_input Function

All instances of checking scancodes will be replaced by the helper function (except for backspace)

func _input(event):
	if(event is InputEventKey and event.pressed): 
		if(SCROLL_SKIPPED_LINES and (_is_input_active(event, UP_SCANCODE, UP_ACTION) or _is_input_active(event, DOWN_SCANCODE, DOWN_ACTION))): # User is just scrolling the text
			if(_is_input_active(event, UP_SCANCODE, UP_ACTION)):
				# ...
			else:
				# ...
		elif(_state == 1 and _on_break): # If its on a break
			if(_is_input_active(event, BREAK_SCANCODE, BREAK_ACTION)):
				# ...
		elif(_state == 2): # If its on the input state
			# ...
			if(event.scancode == KEY_BACKSPACE): # Delete last character
				# ...
			elif(_is_input_active(event, ACCEPT_SCANCODE, ACCEPT_ACTION)): # Finish input
				# ...

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.