Skip to content

Instantly share code, notes, and snippets.

View KinoAR's full-sized avatar
🏠
Working from home

Kino KinoAR

🏠
Working from home
View GitHub Profile
@KinoAR
KinoAR / scroll-factor.hx
Created January 20, 2021 22:15
Scroll Factor example Flixel
class PlayerHUD extends FlxTypedGroup<FlxSprite> {
public function create() {
var myGameUIText = new FlxText(0, 0, 100, 'High Score: 0', 12);
//Sets the scroll factor of the game UIText; this prevents it from scrolling in either direction.
//Note: By default buttons have a scrollFactor of 0.
myGameUIText.scrollFactor.set(0, 0);
add(myGameUIText)
}
}
@KinoAR
KinoAR / tags.hx
Last active January 14, 2021 01:19
Tag examples in Haxe.
//In the output although the class is called ScenePause in Haxe, it will be LunaScenePause in the JS output.
@:native('LunaScenePause')
@:expose
class ScenePause extends Scene_MenuBase {
public var pauseTitleWindow: WindowTitle;
public var pauseMenuWindow: WindowPauseMenu;
public var pauseConfirmWindow: WindowConfirmMenu;
public override function create() {
this.createWindowLayer();
@KinoAR
KinoAR / anon.hx
Created January 6, 2021 23:57
Haxe anonymous structure exmaple
var myObj = {
name: 'Timothy',
health: 3
}
//JS Object Example
/*
const myObj = {
name: "Timothy",
health: 3
@KinoAR
KinoAR / haxe-compile-watch.sh
Created December 14, 2020 23:24
Haxe Compilation Nodemon Watch
nodemon --watch src -e hx,hxml,xml --exec haxe --times --connect 7010 compile.hxml
@KinoAR
KinoAR / haxe-build-command.sh
Created December 14, 2020 23:21
Haxe Compilation Command
haxe --wait 7010
@KinoAR
KinoAR / Window_Help.hx
Created December 1, 2020 00:44
An example of conditional compilation
extern class Window_Help extends Window_Base {
/**
* The text that is displayed within the window.
*
* @protected
* @type {string}
* @memberof Window_Help
*/
private var _text: String;
@KinoAR
KinoAR / conditional-compilation.hxml
Created December 1, 2020 00:38
Conditional Compilation Example
# Standard Build
--next
-js dist/Luna_SocialSystem.js
--next
# This will compile the code and make sure it follows the RPGMakerMV code base.
-D compileMV
-js dist/Luna_SocialSystemMV.js
@KinoAR
KinoAR / compile.hxml
Created December 1, 2020 00:21
A gist example of a haxe build file.
# Haxe Library
-lib LunaTea
-cp src
# JS Version
-D js-es=6
# Enable/Disable console.log -- tracing with the below line
# --no-traces
@KinoAR
KinoAR / gist:155d700e5b56e23869bce50a5a263496
Created October 23, 2020 23:48
Script Calls For Game
Inventory Script Calls
-----------
Opens the Inventory
LunaMMInventory.openInventory()
Closes the Inventory
LunaMMInventory.closeInventory()
Checks if the Inventory is open
LunaMMInventory.isInventoryOpen()
@KinoAR
KinoAR / godot-dollarsign-example.gd
Created October 13, 2019 13:06
An example of using the dollar sign operator access a specific property on an object.
func die()->bool:
hide()
# Accessing the node NAMED CollisionShape2D in the UI.
# If There were subchildren of that node, we'd access it like so $CollisionShape2D/ChildNode
$CollisionShape2D.set_deferred("disabled", true)
queue_free()
return true
# Alternate Syntax