I have been trying to make a model for a game main screen.
(when you first open the game)
I have a background (painted on screen as a bitmap)
I have a button.
I have a button picture (for when the mouse is not over the button)
and
I have an inverted button picture (for when the mouse hovers over the button)
I have been looking around for an answer online but everything i find i don't understand at all.
With the code beneath i expected the picture to be painted above the button and when i pressed the button it would change to the inverted image but i failed.
Problem one:
I can't get the button picture to cover the actual press-able button on the screen.
Problem two:
I don't know how to paint while my mouse is hovering over the button.
Thank you for the help in advance and lets hope that i learn from this!
Here is the code that i have now:
//Bitmaps
m_BmpBackgroundPtr = new Bitmap("Background.png");
m_BmpButtonNewGamePtr = new Bitmap("ButtonNewGame.png");
m_BmpButtonNewGameInvertedPtr = new Bitmap("ButtonNewGameInverted.png");
// Insert the code that needs to be executed at the start of the game
}
// Insert the code that needs to be executed each time a new frame needs to be drawn to the screen
// Technical note: engine uses double buffering when the gamecycle is running
}
void MadThieves::CallAction(Caller* callerPtr)
{
if(callerPtr == m_BtnNewgamePtr)
{
delete m_BmpButtonNewGamePtr;
m_BmpButtonNewGameInvertedPtr = new Bitmap("ButtonNewGameInverted.png");
GAME_ENGINE->DrawBitmap(m_BmpButtonNewGameInvertedPtr,0,0);
}
// Insert the code that needs to be executed when a Caller has to perform an action
}