0 Replies - 231 Views - Last Post: 20 January 2010 - 11:47 AM Rate Topic: -----

#1 roserobe203  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 07-January 10

GUI Bitmap loading

Posted 20 January 2010 - 11:47 AM

I am in need of some assistance with my program. We are trying to recreate a game from Math Circus... Although a simple game i am trying to focus mainly on the graphics, and have hit, for lack of a better word, a road block. I am trying to include some bitmap pictures created in visual C++ 6.0, which is also, obviously the console with which i am working through. In all honesty, i am completely unsure of how to open the bitmaps, and then place them to specific locations on the screen, here is the code for the whole game, so far;
#include <U:\Profile\Desktop\Programming\lvp\gui_top.h>

class GuiClass{
public:
GuiClass();
void GuiMouseClick(int x, int y);
GuiPaint();
String Title();
private:
int LastX;
int LastY;
int FirstNumber;
int SecondNumber;
int LeftFirstNumber;
int LeftSecondNumber;

};

GuiClass::GuiClass():
LastX(100),LastY(100)
{

}

String GuiClass::Title()
{
	return("ClickTracker!");
}

void GuiClass::GuiMouseClick(int x, int y)
{
	
	LastX = x;
	LastY = y;
	
	//Right Boxes, Button Controls
	if((LastX>=10) && (LastX<=100) && (LastY>=320) && (LastY<=420) && (FirstNumber<=9)){
		FirstNumber++;}
	if((LastX>=130) && (LastX<=220) && (LastY>=320) && (LastY<=420) && (FirstNumber>=1)){
		FirstNumber--;}
	//Lower Boxes
	if((LastX>=10) && (LastX<=100) && (LastY>=630) && (LastY<=730) && (SecondNumber<=9)){
		SecondNumber++;}
	if((LastX>=130) && (LastX<=220) && (LastY>=630) && (LastY<=730) && (SecondNumber>=1)){
		SecondNumber--;}
	
	//****************************************************************************************
	//Left Boxes, button controls
	if((LastX>=950) && (LastX<=1040) && (LastY>=320) && (LastY<=420) && (LeftFirstNumber<=29)){
		LeftFirstNumber++;}
	if((LastX>=1070) && (LastX<=1160) && (LastY>=320) && (LastY<=420) && (LeftFirstNumber>=1)){
		LeftFirstNumber--;}
	//Lower Boxes
	if((LastX>=950) && (LastX<=1040) && (LastY>=470) && (LastY<=570) && (LeftSecondNumber<=29)){
		LeftSecondNumber++;}
	if((LastX>=1070) && (LastX<=1160) && (LastY>=470) && (LastY<=570) && (LeftSecondNumber>=1)){
		LeftSecondNumber--;}
}

GuiClass::GuiPaint()
{
	
	//top line
	Rectangle(1, 95, 1270, 94);

	//************************************************
	
	//first box, left side
	Rectangle(10, 320, 100, 420);
	//third box, left side 
	Rectangle(10, 630, 100, 730);

	//************************************************
	
	//first box, right side
	Rectangle(130, 320, 220, 420);
	//third box, right side
	Rectangle(130, 630, 220, 730);

	//************************************************
	//Dollar Boxes, Upper right
	Rectangle(350, 320, 440, 420);	
	//Dollar Boxes, Lower right
	Rectangle(350, 630, 440, 730);
	
	//************************************************
	//Upper Buttons, Left Side
	Rectangle(950, 320, 1040, 420);
	
	Rectangle(1070, 320, 1160, 420);
	
	//************************************************
	//Lower Buttons, Left Side
	Rectangle(950, 470, 1040, 570);

	Rectangle(1070, 470, 1160, 570);
	
	//************************************************
	//Number Buttons Left Side
	Rectangle(800, 320, 890, 420);

	Rectangle(800, 470, 890, 570);

	//************************************************
	//Check Button
	Rectangle(457, 800, 650, 888);

	gotoxy(841, 525);
		DrawText(LeftSecondNumber);
	gotoxy(841, 375);
		DrawText(LeftFirstNumber);
	gotoxy(391, 371);
		DrawText(FirstNumber);
	gotoxy(391, 681);
		DrawText(SecondNumber);
	gotoxy(391, 523);
		DrawText("4");
	gotoxy(523, 371);
		DrawText("@	2$			  =");
	gotoxy(523, 523);
		DrawText("@	3$			  =");
	gotoxy(523, 681);
		DrawText("@	5$			  =													 35");

}

#include <U:\Profile\Desktop\Programming\lvp\gui_bot.h>


Any assistance would be of help, even if it is only a nudge in the right direction. :)

Is This A Good Question/Topic? 0
  • +

Page 1 of 1