So this is how far I got. (not that much I know) but I have something like this: A class called "SplashScreen"
private DynamicButton dynButton;
public override void Init(ContentManager Content)
{
base.Init(Content);
dynButton = new DynamicButton("Test", new Vector2(450, 100), Color.White);}
private void Dyn_Click(object sender, EventArgs e)
{
dynButton.ObjColor = Color.DarkOrange; //I want to do stuff here
}
public override void Update(GameTime gameTime)
{
base.Update(gameTime);
dynButton.Update(gameTime);
dynButton.Click += Dyn_Click;
}
And in my Dynamic Button class as follows:
public event EventHandler Click;
public override void Update(GameTime gameTime)
{
base.Update(gameTime);
this.Click += DynamicButton_Click;
}
private void DynamicButton_Click(object sender, EventArgs e)
{
}
I don't really know how to get the Click event right. So like I have to check my bounds from the object with my mouse that's what I know but how can I make it that the events fires. I just want to call like dynButton.Click += myMethod and in this method I would do stuff. Hope you understand what I mean.(I'm pretty new)