DGElogo

Dragon Engine

Extension Download

Now has extension. Now you not need reopen page everytime to use lua function. Github or VS Code Marketplace.

LUA Set Function

setWindowBorderColor(R:Int = 255, G:Int = 0, B:Int = 0)(1.5.7+)

Set window border color.
R: color of Red Channel(0-255).
G: color of G Channel(0-255).
B: color of Blue Channel(0-255).

setWindowtitleColor(R:Int = 255, G:Int = 0, B:Int = 0)(1.5.7-1.6.3)(Old)

Set window border color.
R: color of Red Channel(0-255).
G: color of G Channel(0-255).
B: color of Blue Channel(0-255).

setWindowColorMode(dark:Bool = true)(1.5.7+)

Decided window border to darkmode.
dark: set to dark mode.

setWindowDarkMode()(1.5.7+)

Set window border to darkmode.

setWindowLightMode()(1.5.7+)

Set window border to lightmode.

setWindowX(value:Int, duration:Float = 0.0, ease:String)(1.5.8+)(Deprecated)

Set window X property.
value: any int number for x window position.
duration: duration for transition.
ease: The tweening method used, example: 'linear', 'circInOut'. All Tween Method.

setWindowY(value:Int, duration:Float = 0.0, ease:String)(1.5.8+)(Deprecated)

Set window Y property.
value: any int number for y window position.
duration: duration for transition.
ease: The tweening method used, example: 'linear', 'circInOut'. All Tween Method.

setWindowWidth(value:Int, duration:Float = 0.0, ease:String)(1.5.8+)(Deprecated)

Set window Width property.
value: any int number for width window.
duration: duration for transition.
ease: The tweening method used, example: 'linear', 'circInOut'. All Tween Method.

setWindowHeight(value:Int, duration:Float = 0.0, ease:String)(1.5.8+)(Deprecated)

Set window Height property.
value: any int number for height window.
duration: duration for transition.
ease: The tweening method used, example: 'linear', 'circInOut'. All Tween Method.

setWindowProperty(x:Null<Int>, y:Null<Int>, width:Null<Float>, height:Null<Float>, duration:Float = 0, ease:String, scale:Bool = false)(1.5.9.5+)

Set window property.
x: window x position(leave empty to ignore).
y: window y position(leave empty to ignore).
width: window width(leave empty to ignore).
height: window height(leave empty to ignore).
duration: duration for transition.
ease: The tweening method used, example: 'linear', 'circInOut'. All Tween Method.
scale: if checked it will use mutliple screen resolution(0(min) to 1(max)).

resetWindow()(1.5.9.5+)

Reset window to last window property before load song.

setSecondOpponent(value:Bool, trasition:Bool, trasition2:Bool)(1.6.0+)

Set between 2nd strums or not.
value:toggle of 2nd strums or normal
trasition: should add strums transition for player.
trasition2: should add strums transition for opponent.

changeGamemode(name:String = 'none', transition:Bool = true)(1.5.9.2+)

Set gamemode.
name: name of gamemode.
transition: set transition or not.

changeSongSpeed(value:Float, duration:Float = 0, ease:String)(1.6.1.8+)

Set song scroll speed.
value: number the scroll speed.
duration: duration of transition change scroll speed.
ease: The tweening method used, example: 'linear', 'circInOut'. All Tween Method.

backgroundColor(R:Int = 0, G:Int = 0, B:Int = 0, A:255)(1.6.3.1+)

Set app background color.
R: color of Red Channel(0-255).
G: color of Green Channel(0-255).
B: color of Blue Channel(0-255)
A: Alpha Channel(not all platform work)(0-255).

mirrorSongSpeed(duration:Float = 0.25, ease:String)(1.6.3.7+)

Mirror song scroll speed and strums y.
duration: duration of transition mirror scroll speed.
ease: The tweening method used, example: 'linear', 'circInOut'. All Tween Method.

changeWallpaper(path:String, absolute:Bool = false)(1.6.3.8m2+)(Windows Only)

Change os wallpaper.
path: the path of images file(must be absolute. example: the example.png in mods/modname/images/ you had write path as mods/modname/images/example.png).
absolute(1.6.3.9+): if true it will use system path(example: C:\Windows\Web\Wallpaper\Windows\img0.jpg. the path must write like C:\\Windows\\Web\\Wallpaper\\Windows\\img0.jpg).

changeNotesTexture(player:Bool = false, gf:Bool = false, texture:String = '')(1.6.3.9m2+)

Change the notes texture.
player: Player or Opponent notes.
gf: Gf notes or normal notes.
texture: What texture should use?.
Info: for ignore change texture, set notes or strums ignoreTextureChange to true.

centerWindow(duration:Float, ease:String)(1.6.3.11+)

Set window to center.
duration: duration of transition to center.
ease: The tweening method used, example: 'linear', 'circInOut'. All Tween Method.

callProperty(variable:String, value:Array<Dynamic>)(1.6.3.11+)

same as setProperty() but use call method/function.
example: adding animation to bf: callProperty('boyfriend.animation.addByPrefix', {'youanimname', 'xml animation name'}).

callPropertyFromGroup(obj:String, index:Int, value:Array<Dynamic>)(1.6.3.11+)

same as setPropertyFromGroup() but use call method/function.
example: adding animation to strums 0: callPropertyFromGroup('strumLineNotes', 0, {'youanimname', 'xml animation name'}).

changeRatingTexture(rating:String, path:String)(1.6.3.15+)

change rating texture.
rating: rating name to change('sick', 'good', 'bad', 'shit', and 0-9(string only)).
path: texture file path in images/.

resizeGame(width:Null<Int> = null, height:<Int> = null, resetLayout:Bool = false, duration:Float = 0, ease:String, excludeCam:String)(1.6.3.16m2+)

resize game world resolution.
width: size width of game world resolution.
height: size height of game world resolution.
resetLayout: should layout ui layout reset?
duration: duration for transition.
ease: The tweening method used, example: 'linear', 'circInOut'. All Tween Method.
excludeCam: exclude cam from resize(separate with comma example: 'hud, game').
Warning: best use in onCreate(). in other function can use but the camera character slightly bit off.

changeNotesSplashTexture(player:Bool = false, gf:Bool = false, texture:String = 'noteSplashes')(26.2.0+)

Change the notes splash texture.
player: Player or Opponent notes.
gf: Gf notes or normal notes.
texture: What splash texture should use?.
Info: for ignore change texture, set notes or strums ignoreTextureChange to true.

LUA Get Function

getResolutionWidth()(1.5.8+)

return Int of monitor width resolution. Shortcut of getPropertyFromClass('openfl.Lib', 'application.application.window.display.bounds.width').

getResolutionHeight()(1.5.8+)

return Int of monitor height resolution. Shortcut of getPropertyFromClass('openfl.Lib', 'application.application.window.display.bounds.height').

getBlendFromString(blend:String)(1.6.3.8+)

return BlendMode from String.

getCurrentWallpaperPath()(1.6.3.10+)(Windows Only)

return String of wallpaper path

getColorFromRGB(R:Int, G:Int, B:Int, A:Int = 255)(1.6.3.11+)

return Int or Color ID of from RGB.

customCameraExists(tag:String = '')(1.6.3.11+)

return Bool if custom camera exists.
tag: name of custom camera to check if exists.

customStrumExists(tag:String = '')(1.6.3.11+)

return Bool if custom strums/field exists.
tag: name of custom strum/field to check if exists.

getWindowProperty(type:String = 'x')(1.6.3.11+)

return Dynamic of window property.
type:type property to get(only x, y, width, height)

customButtonExists(tag:String = '')(26.1.0+)

return Bool if custom button exists.
tag: name of custom button to check if exists.

customToggleExists(tag:String = '')(26.1.0+)

return Bool if custom toggle exists.
tag: name of custom toggle to check if exists.

formatTimeFromSecond(second:Float = 0, showMS:Bool = false)(26.1.1+)

return String of formatted time from second example:63 second to 1:03.
second: number of second to format.
showMS: should show millisecond?

LUA Obj Function

createCustomStrum(tag:String, data:Int = 4, camera:String = 'hud', scroilX:Float = 0, scrollY:Float = 0, downscroll:Null<Bool>, player:Bool = false, gf:Bool = false)(1.6.0+)

create custom field.
tag: tag name for custom field.
data: how much strum to spawn.
camera: camera target to custom field(selection: 'game', 'hud', 'other').
scrollX : scroll speed of x.
scrollY : scroll speed of y.
downscroll: should down scroll?(if not set it will use current setting).
player(26.2.4+): created as player strums(affected to different noteskin or 2nd strums mode(if enable)).
gf(26.2.4+): created as gf strums(affected to different noteskin or 2nd strums mode(if enable)).

removeStrum(tag:String)(1.6.0+)

remove custom field.
tag: tag name custom field.

addCamera(name:String = '', x:Int, y:Int, width:Int, height:Int, zoom:Float = 1, ?sectionZoom:Bool = false)(1.6.2+)

add custom camera.
name: name custom camera(use 'camera:yourcameraname' if want access to setProperty() or getProperty()).
x: camera x position.
y: camera y position.
width: camera width.
height: camera height.
zoom: camera zoom(also as default zoom if sectionZoom is true(26.2.1+)).
Warning: the last cameras always use by pause screen(not related after 1.6.3+).
sectionZoom(26.2.1+): make camera act like camHUD zooming.

removeCamera(name:String = '')(1.6.2+)

remove custom camera.
name: name custom camera.

luaAlert(content:String = 'Hi, I\'m the who make this engine', title:String = 'DubEnderDragon')(1.6.2.2+)

make alert box.
content: content of alert.
title: title of content.

openURL(web:String = 'https://github.com/DibyoExcel/Dragon-Engine')(1.6.3.5+)

open the webpage.
web: the link to open pages.

debugPrintArray(text:Array<Dynamic>)(1.6.3.10+)

same as debugPrint() but with array.

precacheSparrowAtlas(name:String)(1.6.3.17m1+)

precache Sparrow Atlas Frames(Recommended put in onCreate())
name:name of atlas file in images/.

precachePackerAtlas(name:String)(1.6.3.17m1+)

precache Packer Atlas Frames(Recommended put in onCreate())
name:name of atlas file in images/.

addButton(tag:String, x:Float, y:Float, texture:String, camera:String = 'hud', ?width:Int = 125, ?height:Int = 125)(26.1.0+)

Add button object.
tag: tag name of button(access object as customButtonMap@tag).
x: x position of button.
y: y position of button.
texture: texture file in images/.
camera: camera target to button(selection: 'game', 'hud', 'other')(can be multi cam with comma. example: hud, other.).
width: width size of button.
height: height size of button.

removeButton(tag:String)(26.1.0+)

Remove button object.
tag: tag name of button.

addToggle(tag:String, x:Float, y:Float, texture:String, camera:String = 'hud', ?width:Int = 125, ?height:Int = 125, ?initialState:Bool = false)(26.1.0+)

Add toggle object.
tag: tag name of toggle(access object as customToggleMap@tag).
x: x position of toggle.
y: y position of toggle.
texture: texture file in images/.
camera: camera target to toggle(selection: 'game', 'hud', 'other')(can be multi cam with comma. example: hud, other.).
width: width size of toggle.
height: height size of toggle.
initialState: initial state of toggle(true:on, false:off).

removeToggle(tag:String)(26.1.0+)

Remove toggle object.
tag: tag name of toggle.

LUA Callback Function

opponentNoteMiss(id:Int, noteData:Int, noteType:String, isSustainNote:Bool)(1.5.7+)

same as noteMiss(id:Int, noteData:Int, noteType:String, isSustainNote:Bool) but for opponent and most use for bothside and opponent gamemode.

opponentNoteMissPress(noteData:Int)(1.5.7+)

same as noteMiss(noteData:Int) but for opponent and most use for opponent gamemode.

onChangeGamemode(name:String, transition:Bool)(1.6.0.6+)

function when change gamemode(from changeGamemode())
name: returning the gamemode name after change.
transition(1.6.1.2+): return bool after change gamemode transition.

onChangeOpponent(dualstrum:Bool, transition:Bool, transition2:Bool)(1.6.0.6+)

function when change 2nd strums(from setSecondOpponent()).
dualstrum:returning bool of 2nd strums mode after change.
transition(1.6.1.2+): returning bool of transition after change.
transition2(1.6.1.2+): returning bool of transition2 after change.

onRatingPopUp(noteId:Int, ratingId,:Int noteData:Int, noteType:String)(1.6.0.16+)

function when pop up rating.
noteId: A Current note hit id.
ratingId: A Current Rating id.
noteData: a current noteData.
noteType: a current noteType.

onNumPopUp(noteId:Int, numId:Int, noteData:Int, noteType:String)(1.6.0.16+)

function when pop up combo number.
noteId: A Current note hit id.
numId: A Current Num id.
noteData: a current noteData.
noteType: a current noteType.

onComboPopUp(noteId:Int, comboId:Int, noteData:Int, noteType:String)(1.6.0.16+)

function when pop up combo.
noteId: A Current note hit id.
comboId: A Current combo hit id.
noteData: a current noteData.
noteType: a current noteType.

onSpawnNoteSplashes(noteId:Int, splashId:Int, noteData:Int, noteType:String)(1.6.0.16+)

function when spawn note splash.
noteId: A Current note hit id.
splashId: A Current splash id.
noteData: A current noteData.
noteType: A current noteType.

LUA Variable Function

gamemode(1.5.9+)

return String of current gamemode.

extraui(1.6.0.7+)

return Bool of "Extra UI" Setting.

darkmode(1.6.1.10+)

return Bool of "Dark Mode" Setting.

startPause(1.6.1.10+)

return Bool of "Start Pause" Setting.

defaultGfStrumX0(1.6.0.9+)

return Float of strums X0 gfStrums(2nd Opponent Strums only).

defaultGfStrumX1(1.6.0.9+)

return Float of strums X1 gfStrums(2nd Opponent Strums only).

defaultGfStrumX2(1.6.0.9+)

return Float of strums X2 gfStrums(2nd Opponent Strums only).

defaultGfStrumX3(1.6.0.9+)

return Float of strums X3 gfStrums(2nd Opponent Strums only).

defaultGfStrumY0(1.6.0.9+)

return Float of strums Y0 gfStrums(2nd Opponent Strums only).

defaultGfStrumY1(1.6.0.9+)

return Float of strums Y1 gfStrums(2nd Opponent Strums only).

defaultGfStrumY2(1.6.0.9+)

return Float of strums Y2 gfStrums(2nd Opponent Strums only).

defaultGfStrumY3(1.6.0.9+)

return Float of strums Y3 gfStrums(2nd Opponent Strums only).

engineversion(1.6.3.1+)

return String of DGE Version.

deviceModel(1.6.3.12+)

return String of Device Model.

deviceVendor(1.6.3.12+)

return String of Device Vendor.

platformLabel(1.6.3.12+)

return String of Platform Label.

platformName(1.6.3.12+)

return String of Platform Name.

platformVersion(1.6.3.12+)

return String of Platform Version.

camGameMult(1.6.3.16m2+)

return Float of Multiply resolution fill content from resizeGame().

isMobile(26.0.1+)

return Bool if current platform is mobile.

modchart(26.2.1+)

return Bool of "Modchart" Setting.

noteMechanic(26.2.1+)

return Bool of "Note Mechanic" Setting.

LUA Set(Build In Override) Function

setObjectCamera(obj:String, camera:String)(1.6.2+)

Changes on which camera should your object be drawn on.
obj: Lua Sprite tag or Object variable name.
camera: camera to set, like game, hud, other or customCamera(use addCamera())(Separate with comma. Example: game, hud).

LUA Get(Build In Override) Function

getTextFromFile(path:String, ?ignoreModFolders:Bool = false, ?forceFromDisk = false)(1.6.3.17m1+)

Returns content of specific file in text.
path: Path to file
ignoreModFolders: If true, it'll ignore mod folders and only check in base game folder
forceFromDisk: If true, it'll force load file from disk instead of cache(false by default for performance).