C
C#2mo ago
unluqy

making interface button

im just having trouble somehow implementing a button, i tried watching a tutorial but he talks about so many complex thijgs such as an eventHandle clikc and later doing click?.invoke(this, eventargs) that it just didnt make sense to me... so how would you go about making a button for my homeScreen (the homeScreen is one of the screens on my interface) i sorrta can map out what to do just do not know hwo to, i guess id have to make a button class with a texture,position and rect along with draw and load methods but i tried this and couldnt pass down the contentmanager to load the textures eyc, i also tried passing it down in my screenManager but then i had to make whole new instances of the object in my methods and it would never be able to load the textures it needed to draw them out, so nothing would be output onto the screen e.g public Load(){ texture = content.Load<Texture2D>(texture ong) Button MainMenu = new Button (texture) mainMenu.Load(texture) } public Draw(){ Button MainMenu = new Button () mainMenu.Draw() } (the code isnt perfect i just handtyped it on phone and sorry if everything is a bit vague)
2 Replies
Omnissiah
Omnissiah2mo ago
is this unity?
unluqy
unluqyOP2mo ago
monogame i sorta got help on it, ill be trying to implement it tomorrow but feel free to give ur input too!
Want results from more Discord servers?
Add your server