I’m currently stuck on making the title screen to a game I’ve been planning.
The form loads and TMRopI (a timer) starts ticking, Increasing the opacity of the form, creating a fade in effect, and revealing a logo on the form. every time the timer ticks, an integer increases by 1 (or at least it’s supposed to). A picturebox should become visible after the integer reaches 150 (the form is at full opacity when the integer equals 100) creating a pause before the picture is changed. The only problem is, it seems to be comepleteley ignoring my integer.
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
TMRopI->Enabled=true;
}
private: System::Void TMRopI_Tick(System::Object^ sender, System::EventArgs^ e) {
int num=0;
num+=1;
this->Opacity+=0.01;
if (num >= 150)
PBXtitle->Visible=true;
}
Another option is to change the definition of
numtostatic. However, makingnuma member variable of the class is the moreC++way to do it.This way,
numgets set to 0 on the first call to the function and it’s value is saved between subsequent calls.