C
C#2mo ago
tonir66

hello this is video of one of my biggest problems PLEASE ANYONE HELP ME

65 Replies
Salman
Salman2mo ago
I've told you already, nobody would be able to help you with merely a video. You need to share code and full details
Frite
Frite2mo ago
we don't even know what is wrong
Buddy
Buddy2mo ago
$details
MODiX
MODiX2mo ago
When you ask a question, make sure you include as much detail as possible. Such as code, the issue you are facing, what you expect the result to be, what .NET version you are using and what platform/environment (if any) are relevant to your question. Upload code here https://paste.mod.gg/, save, and copy the link into chat for others to see your shared code! (see $code for more information on how to paste your code)
tonir66
tonir662mo ago
this problem is not from the code from the start it makes this like blinking but i dont know why but its not from the code and i am wondering how to fix it but here is the code just to be sure
tonir66
tonir662mo ago
i want just to say before anyone judges i am trying to learn so my code is not organized and logic is bad too but its working for now
br4kejet
br4kejet2mo ago
What do you want to happen that isn't happening in that app of yours? Rock counter is jumping all over the place, do you want it to increment by 1 when you click the rock or something?
tonir66
tonir662mo ago
if you have watched video you can see that is bl9inking i am using windows forms cuz i dont know how to use unity still but i dojnt know how to fix this
br4kejet
br4kejet2mo ago
Nothing is blinking though
tonir66
tonir662mo ago
mb my englih is not good but i mean when i close the upgrade scroll
br4kejet
br4kejet2mo ago
Do you mean the window on the left is flashing white when it closes?
tonir66
tonir662mo ago
you can see YEAH and when lets say it goes to big number starts to do it again
br4kejet
br4kejet2mo ago
Do you run some code like form.Close()?
tonir66
tonir662mo ago
no its just visible true and flase false* where did you saw rock counter btw? do you mean just rocks?
br4kejet
br4kejet2mo ago
Top of the screen Which method is called by that close button, the one with the <| kind of shape
tonir66
tonir662mo ago
let me check i just use this
tonir66
tonir662mo ago
No description
br4kejet
br4kejet2mo ago
Which button calls button5_Click? I suspect what happens is you set the width to 0 after you hide everything Forms draws a white background by default so maybe set the width to 0 in panel14_Click
private void panel14_Click(object sender, EventArgs e)
{
panel2.Visible = false;
panel14.Visible = false;
panel15.Visible = true;
panel8.Width = 0;
}
private void panel14_Click(object sender, EventArgs e)
{
panel2.Visible = false;
panel14.Visible = false;
panel15.Visible = true;
panel8.Width = 0;
}
tonir66
tonir662mo ago
ok let me try its the same
br4kejet
br4kejet2mo ago
Either that or in the constructor, put
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
this.BackColor = Color.Transparent;
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
this.BackColor = Color.Transparent;
tonir66
tonir662mo ago
nothing changed
br4kejet
br4kejet2mo ago
Then add this method
protected override void OnPaintBackground(PaintEventArgs e) { /* Ignore */ }
protected override void OnPaintBackground(PaintEventArgs e) { /* Ignore */ }
tonir66
tonir662mo ago
whre is the constructor
br4kejet
br4kejet2mo ago
public Form1() Also add this.TransparencyKey = Color.Transparent; // I had to add this to get it to work. below the this.BackColor part
tonir66
tonir662mo ago
No description
tonir66
tonir662mo ago
this
br4kejet
br4kejet2mo ago
Yeah put the code below the InitializeComponent
tonir66
tonir662mo ago
ok let me try
br4kejet
br4kejet2mo ago
Then add that method below the constructor Constructor is just a regular method except it's called when you use the new keyword Constructor as in a method that constructs the object
tonir66
tonir662mo ago
No description
br4kejet
br4kejet2mo ago
Replace the ; with {}
tonir66
tonir662mo ago
mb xD ok done let me check
br4kejet
br4kejet2mo ago
If that dunna work then i'm not sure
tonir66
tonir662mo ago
YOU ARE FUCKING HERO HOW TF YOU DID THAT
br4kejet
br4kejet2mo ago
You definitely wanna name buttons instead of using things like button1, etc
tonir66
tonir662mo ago
you are too good
br4kejet
br4kejet2mo ago
White background by default so you just set it to transparent
tonir66
tonir662mo ago
you saved me but i have one more question which is the easiest way to learn how to use unity cuz i tried but its very diffrent from windows forms
br4kejet
br4kejet2mo ago
Unity vs windows forms you mean?
tonir66
tonir662mo ago
yeah i trie to switch i want to use unity
br4kejet
br4kejet2mo ago
They're 2 very different things but winforms is definitely a ton easier
tonir66
tonir662mo ago
yeah exactly but
br4kejet
br4kejet2mo ago
Unity has the weirdest GUI system
tonir66
tonir662mo ago
unity better and the biggest problem in unity is that i dont know how to combine the code like here is everything together
br4kejet
br4kejet2mo ago
Unity lets you customise the look of any control you want but windows forms doesn't let you do it so easily
tonir66
tonir662mo ago
but there is everything seperate yeahz and i can doo animations\ and stuff
br4kejet
br4kejet2mo ago
I'd learn something like WPF, or if you want to do other platforms at the cost of a bigger headache, Avalonia If you use the .NET Framework version of WPF, it has a designer so you can pick and place controls on the screen You can make any style of button, text box, or even you own controls that look however you want
tonir66
tonir662mo ago
yeah but do you know how to do the code in unity
br4kejet
br4kejet2mo ago
Unity is a game engine so UI stuff is only the small part
tonir66
tonir662mo ago
like to combine it all together
br4kejet
br4kejet2mo ago
I've made a few UIs in unity but i dunno what you mean by combine the code
tonir66
tonir662mo ago
like in windows forms i write the code for everything like buttons panels together and i cna use the variables but in unity i have to create scripts for everything seperate like scri[t for ecery button and i dont know how to use the variables in other scripts globaly
br4kejet
br4kejet2mo ago
Different workflow then I guess, when I did a UI, it was some really cheeks, you do stuff like UITool.Button(10, 10, "Click me!", whateverElse) Oh wait C# scripts
tonir66
tonir662mo ago
yeah
br4kejet
br4kejet2mo ago
I didn';t know you could attach them to a button or whatever Never done that But I can see how that might work though
tonir66
tonir662mo ago
if i knew how to sue use* the variables globaly it will be diffrent stor story*
br4kejet
br4kejet2mo ago
I'd still rather write a UI in WPF though, since unity is kinda a game engine and uses a ton of system resources just to draw a few rectangles, WPF does absolutely nothing until you interact with the app, saves you some CPU Or even windows forms worst case
tonir66
tonir662mo ago
so you suggest me to use WPF?
br4kejet
br4kejet2mo ago
But if you;'re making a game then well you kinda have to use unity lel If all you're doing is making a simple app with no kind of 3D then i would recommend to Well WPF can do 3D but it's not like you import .obj and a camera
tonir66
tonir662mo ago
I want to do games Like this game I am doing Is simple Clicking Simulator
br4kejet
br4kejet2mo ago
Then you definitely wanna learn the unity UI stuff Look up tutorials for making a sidebar that can be opened/closed I've never done this deep stuff in unity so can't help rip
tonir66
tonir662mo ago
Yeah you are right Thank you For fixing
br4kejet
br4kejet2mo ago
Np
tonir66
tonir662mo ago
The problem I had
Want results from more Discord servers?
Add your server