diff --git a/wiki/Tips-1.png b/wiki/Tips-1.png new file mode 100644 index 00000000..66aa1d8b Binary files /dev/null and b/wiki/Tips-1.png differ diff --git a/wiki/Tips-2.png b/wiki/Tips-2.png new file mode 100644 index 00000000..53102d0b Binary files /dev/null and b/wiki/Tips-2.png differ diff --git a/wiki/Tips-3.png b/wiki/Tips-3.png new file mode 100644 index 00000000..a4eebf04 Binary files /dev/null and b/wiki/Tips-3.png differ diff --git a/wiki/Tips-4.png b/wiki/Tips-4.png new file mode 100644 index 00000000..b61a06d9 Binary files /dev/null and b/wiki/Tips-4.png differ diff --git a/wiki/index.md b/wiki/index.md index d8f493f7..acd1a201 100644 --- a/wiki/index.md +++ b/wiki/index.md @@ -12,6 +12,7 @@ Here is documentation on functions of the engine (gameplay and modding), and how - Differences between the other FNF engines - FAQ - Troubleshooting +- Tips & Tricks - Modding the engine - Creating songs - Chart Editor Features diff --git a/wiki/tips.md b/wiki/tips.md new file mode 100644 index 00000000..28d9270b --- /dev/null +++ b/wiki/tips.md @@ -0,0 +1,91 @@ +--- +author: hifish +desc: This page has small general tips and tricks. +lastUpdated: 2025-01-11T23:44:26.934Z +title: Tips & Tricks +--- +# Tips & Tricks +##

Add sprite/object behind or above another

+ +You may have a sprite that you might wanna put above or below another sprite. This is possible using the `insert(position:Int, object:T)` function. +```haxe +var blueSolid = new FunkinSprite(200, 200).makeSolid(200, 200, FlxColor.RED); +add(blueSolid); + +var redSolid = new FunkinSprite(250, 250).makeSolid(100, 100, FlxColor.RED); +insert(members.indexOf(blueSolid)+1, redSolid); +/* +This would add the red solid right above the blue solid. If we want it below the blue +solid, we would use the insert function, like so. +*/ +insert(members.indexOf(blueSolid), redSolid); + +``` +##

Set Window Name

+ +Instead of the window name being "Friday Night Funkin' - Codename Engine", you can change it to be whatever you want. + +Start by editing or making a script named `global` in `your mod/data`. + +Now, you can add these lines. + +```haxe +import funkin.backend.utils.WindowUtils; //Put this at the top of the file. + +WindowUtils.winTitle = 'Your Mod Name'; +/* +This line could either be added outside of a function, or you could put it in +function new() +*/ +``` + +Using this over `window.title` is much better, since it won't reset on state changes. + +##

Preloading Sprites

+ +It's literally just one line. + +```haxe +graphicCache.cache(Paths.image('your image')); +``` + +##

Adding the mod switch menu to a ModState.

+ +An image showing the mod switch menu in the normal main menu state. + +If you want to add this mod switch menu to your custom mod state, it is relatively simple. + +```haxe +import funkin.menus.ModSwitchMenu; //Import the menu. + +if (controls.SWITCHMOD) //Or any sort of event you want this to happen +{ + openSubState(new ModSwitchMenu()); + persistentUpdate = false; + persistentDraw = true; +} + +//You can also do the same thing with the editor picker. +import funkin.editors.EditorPicker; + +if (FlxG.keys.justPressed.SEVEN) //Or any sort of event you want this to happen +{ + openSubState(new EditorPicker()); + persistentUpdate = false; + persistentDraw = true; +} + +``` + +##

Set BPM for an audio file without code.

+ +You may want an audio file to have a BPM assigned to it, like the menu music. + +To do this, navigate to the folder that has the audio you want to assign a BPM to (ex: freakyMenu.ogg). +An image showing a file named "freakyMenu.ogg" in the file explorer. + +Now, create an .ini file with the same name as the audio file you want to assign a BPM to, and open the file and add `BPM=your bpm value`. +An image showing two files in the file explorer both named "freakyMenu", with the different file extensions ".ini" and ".ogg". +An image showing a file named "freakyMenu.ini" in the notepad editor, with it saying "BPM=100" in the file. + +Please note that you must use `CoolUtil.playMusic()` for the .ini file to have any effect. diff --git a/wiki/wiki.json b/wiki/wiki.json index 608ed1c9..8bfb5e4a 100644 --- a/wiki/wiki.json +++ b/wiki/wiki.json @@ -4,6 +4,7 @@ ["differences", "Differences between other FNF engines"], ["faq", "FAQ"], ["troubleshooting", "Troubleshooting"], + ["tips", "Tips & Tricks"], ["modding/index", "Modding The Engine", [ ["songs/index", "Creating songs", [ ["editor-features", "Chart Editor Features"],