とりあえず疑問点に関連するであろうソースを載せていきます。
Title.h
#ifndef TITLE_H
#define TITLE_H
#include"Scene.h"
#include"Button.h"
#include"Label.h"
class TITLE : public SCENE{
private:
BUTTON *StartButton;
BUTTON *StageSelectButton;
BUTTON *ConfigButton;
BUTTON *EndButton;
LABEL *TitleLabel;
int Score;
public:
//描画
int Draw();
TITLE();
~TITLE();
};
#endif TITLE_H
#include"Title.h"
#include"Scene.h"
#include"DxLib.h"
#include<vector>
TITLE::TITLE() : SCENE(){
std::vector<POSITION*> Position;
Position.push_back(&POSITION(0.0,0.0));
Position.push_back(&POSITION(200.0,300.0));
Position.push_back(&POSITION(200.0,400.0));
Position.push_back(&POSITION(200.0,500.0));
Position.push_back(&POSITION(200.0,600.0));
Position.push_back(&POSITION(200.0,50.0));
std::vector<IMAGE*> Image;
Image.push_back(&IMAGE("BackGround.png",1,1));
Image.push_back(&IMAGE("StartButton.png",1,1));
Image.push_back(&IMAGE("ConfigButton.png",1,1));
Image.push_back(&IMAGE("StageSelectButton.png",1,1));
Image.push_back(&IMAGE("EndButton.png",1,1));
Image.push_back(&IMAGE("TitleLabel.png",1,1));
SOUNDEFFECT* sndef = new SOUNDEFFECT("ChangeButton.mp3",1);
this->BackGround = new BACKGROUND(Image[0],Position[0]);
this->StartButton = new BUTTON(Image[1],Position[1],sndef);
this->ConfigButton = new BUTTON(Image[2],Position[2],sndef);
this->StageSelectButton = new BUTTON(Image[3],Position[3],sndef);
this->EndButton = new BUTTON(Image[4],Position[4],sndef);
this->TitleLabel = new LABEL(Image[5],Position[5]);
this->BackMusic = new SOUNDEFFECT("Title.mp3",1);
}
TITLE::~TITLE(){}
int TITLE::Draw(){
std::vector<IMAGE*> Image;
Image.push_back(this->StartButton->GetImage());
std::vector<POSITION*> Position;
Position.push_back(this->StartButton->GetPosition());
Position.push_back(this->EndButton->GetPosition());
DxLib::printfDx("pox : %lf , poy : %lf\n",Position[0]->GetX(),Position[0]->GetY());
//背景画像の表示
//タイトル画像の表示
//始めるのボタンの表示
//DxLib::DrawGraph( Position[0]->GetX() , Position[0]->GetY() , Image[0]->GetImage(0) , 1 );
//ステージセレクトのボタンの表示
//コンフィグのボタンの表示
//終わりのボタンの表示
return 0;
}
#include"Button.h"
#include"DxLib.h"
SOUNDEFFECT *BUTTON::GetSoundEffect(){ return this->SoundEffect; }
POSITION *BUTTON::GetPosition(){ return this->Position; }
IMAGE *BUTTON::GetImage(){ return this->Image; }
int BUTTON::Sound(){ return 0; }
int BUTTON::GetChoose(){ return this->Choose; }
int BUTTON::SetChoose( int choose ){ return this->Choose = choose; }
BUTTON::BUTTON( IMAGE *image , POSITION* position , SOUNDEFFECT *soundeffect ){
this->Choose = 0;
IMAGE *img = new IMAGE("Frame.png",1,1);
this->Frame = new FRAME(img,this->Position);
this->Image = image;
this->Position = position;
this->SoundEffect = soundeffect;
}
BUTTON::BUTTON(){}
BUTTON::BUTTON( BUTTON &&button ){}
BUTTON::~BUTTON(){}
#ifndef BUTTON_H
#define BUTTON_H
#include"Frame.h"
#include"SoundEffect.h"
class BUTTON{
private:
SOUNDEFFECT *SoundEffect;
IMAGE *Image;
POSITION *Position;
FRAME *Frame;
int Choose;
public:
int Sound();
int GetChoose();
int SetChoose( int choose );
IMAGE *GetImage();
POSITION *GetPosition();
SOUNDEFFECT *GetSoundEffect();
BUTTON( IMAGE *image , POSITION* position , SOUNDEFFECT *soundeffect );
BUTTON();
BUTTON( BUTTON &&button );
~BUTTON();
};
#endif BUTTON_H
#include"Frame.h"
FRAME::FRAME( IMAGE *image , POSITION *position ){
this->Position = position;
this->Image = image;
}
FRAME::FRAME(){}
FRAME::FRAME( FRAME &&frame ){}
FRAME::~FRAME(){}
#ifndef FRAME_H
#define FRAME_H
#include"Image.h"
#include"Position.h"
class FRAME{
private:
IMAGE *Image;
POSITION *Position;
public:
FRAME( IMAGE *image , POSITION *position );
FRAME();
FRAME( FRAME &&frame );
~FRAME();
};
#endif FRAME_H
#include"Image.h"
#include"DxLib.h"
#include<string>
int IMAGE::GetImage( int imagenumber ){
return this->ImageData[imagenumber];
}
IMAGE::IMAGE( std::string filename , int numberx , int numbery ){
int imagedata = DxLib::LoadGraph(filename.c_str());
int *imagedatas = new int[numberx*numbery];
DxLib::GetGraphSize(imagedata,&this->SizeX,&this->SizeY);
DxLib::LoadDivGraph(filename.c_str(),numberx*numbery,numberx,numbery,this->SizeX/numberx,this->SizeY/numbery,imagedatas);
for( int i=0; i<numberx*numbery; i++ ) this->ImageData.push_back(imagedatas[i]);
delete[] imagedatas;
}
IMAGE::IMAGE(){}
IMAGE::IMAGE( IMAGE &&image ){}
IMAGE::~IMAGE(){}
#ifndef IMAGE_H
#define IMAGE_H
#include<vector>
class IMAGE{
private:
std::vector<int> ImageData;
int SizeX;
int SizeY;
int ImageNumber; //画像数
public:
int GetImage( int imagenumber );
IMAGE( std::string filename , int numbery , int numberx );
IMAGE();
IMAGE( IMAGE &&image );
~IMAGE();
};
#endif IMAGE_H
そこで表示されるPositionやImageの値が0.0のままで変化がないのです。
頭の悪い質問ですがこの中に値を入れるにはどのような書き換えが必要なのでしょうか?
お願いします。