LEARN COOL THINGS IN SOURCE AND LUA WITH TONY (please take psych away from me) #2
RealDealJinx
started this conversation in
Showcase and tell (Lua and Source)
Replies: 1 comment 1 reply
-
sorry if its very shitty |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
ok basiclly you will learn cool funky shit in both Lua and Source
SOURCE TUTORIALS:
CLICKABLE MENU SPRITES
Now the menu looks very boring and you want clickable menu sprites! (why will i leak my own mod)
but you ran in the problem, how?
well say no more (i hope)
today i will teach you
the end you should get this:
2022-07-29.14-37-33.mp4
Lets start
Step 1:
Compile Psych if you havent (learn here)
Step 2:
make a new .hx and name it to whatever you want
for me we will name it to AdastraState.hx
(for anyone who doesnt know .hx is basiclly standing for Haxe File)
Step 3:
in our .hx file we will add
package;
package is really important if its a really big thing like PlayState or TitleState, stuff like FunkinLua dont need one cause it doesnt actuall run in the game, like it doesnt handle the strum lines or bf Ground and stuff
now under package your gonna copy and past all of the following import files
All of these are just handlers for our stuff
now in order to write our functions we must add this
Change Adastra State to what you named your file,
ex: if you named your file, CoolState.hx you will do
class CoolState extends MusicBeatState
again its just a handler
Step 4:
now we are gonna add these 2 important function but before we must add a varible
if you used lua alot then you may know what a tag is, varibles are basiclly tags
so we are gonna write for our first option
var tag1:FlxSprite;
with this, you can have unlimited amount of varibles that you need.
you should have something like this so far
now we need to add this
under all the tags/varibles you made
put this
private var camGame:FlxCamera;
step 5:
after that lets make our function
name it
override function create()
this is where we will create all of our sprites
in that we will put all of these varibles to help it
now we are finally able to make our sprites
before make sure it looks like this
under #end add this and only modify where it says modify
if its out of order or you want it to be center you can add these
out of order thing:
center:
make sure its in the thing like this
we are almost done!
we are gonna add one more function
just copy this code im too lazy
put this under the bracket of our function
Ending:
if we did all the steps corectly it should look like this
There you go! custom clickable menu
please let me know if their is any errors
LUA TUTORIALS:
none :(
Beta Was this translation helpful? Give feedback.
All reactions