This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@tool | |
class_name StyleBoxShader extends StyleBox | |
@export var material:Material | |
@export var texture:Texture2D | |
# the canvas item we are going to use | |
var canvas_item_rid:RID | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@tool | |
extends Node | |
func _add_inspector_buttons() -> Array: | |
var buttons = [] | |
buttons.push_back({ | |
"name": "Test button", | |
"icon": preload("res://icon.svg"), | |
"pressed": _on_test_button_pressed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@tool | |
extends EditorScript | |
func _run() -> void: | |
var interface = get_editor_interface() | |
var base = interface.get_base_control() | |
# Find the Project Settings Editor | |
var settings = base.find_child('*ProjectSettingsEditor*', true, false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# res://globals.gd added as an autoload | |
extends Node | |
func _ready() -> void: | |
EngineDebugger.register_message_capture("tile-instances", _on_tile_instances) | |
EngineDebugger.send_message.call_deferred("tile-instances:get_id", []) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import haxe.macro.Context; | |
import haxe.macro.Expr; | |
class Macros { | |
macro public static function autoInt():Array<Field> { | |
var fields = Context.getBuildFields(); | |
var t = switch(Context.getLocalClass().get().kind) { | |
case KAbstractImpl(c): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma warning disable 109, 114, 219, 429, 168, 162 | |
public class EntryPoint__Main { | |
public static void Main() { | |
global::cs.Boot.init(); | |
global::Main.main(); | |
} | |
} | |
public class Main : global::haxe.lang.HxObject { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import haxe.ds.Either; | |
abstract OneOf<A, B>(Either<A, B>) from Either<A, B> to Either<A, B> { | |
@:from inline static function fromA<A, B>(a:A) : OneOf<A, B> return Left(a); | |
@:from inline static function fromB<A, B>(b:B) : OneOf<A, B> return Right(b); | |
@:to inline function toA():Null<A> return switch(this) {case Left(a): a; default: null;} | |
@:to inline function toB():Null<B> return switch(this) {case Right(b): b; default: null;} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Assert { | |
public static inline function assert(truth: Bool) { | |
#if debug | |
if (!truth) { | |
trace('assert failed'); | |
} | |
#end | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ; | |
#if macro | |
import haxe.macro.Context; | |
import haxe.macro.Printer; | |
import haxe.macro.Expr; | |
class MacroEnum { | |
macro public static function buildToString():Array<Field> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//change line 39 to this | |
super(Math.floor(stageWidth / ratio), Math.floor(stageHeight / ratio), Piramid, ratio, 30, 30); |