Results 1 to 1 of 1
I'm having some trouble with getting my images to draw properly. I have an Image class that gets passed the filepath, x and y position, and whether or not the ...
- 03-11-2009 #1Just Joined!
- Join Date
- Mar 2009
- Posts
- 1
SDL_Rect Problem
I'm having some trouble with getting my images to draw properly. I have an Image class that gets passed the filepath, x and y position, and whether or not the image should be drawn. But if I pass it 100 for both the x and y, it draws at -100, -100.
I can't see anything wrong that would make this happen, unless there is something about coordinates in SDL that is doing this.Code:// Initializing the Image m_playGameButton = new Image("Resources/GUI/Main/play_game_button.png", 100, 100, true); // Drawing the image SDL_BlitSurface( m_playGameButton->GetSurface(), &m_playGameButton->GetRect(), game->GetScreen(), NULL); // In the header SDL_Rect GetRect() { return m_rect; } // In the Image.cpp file Image::Image(char *filepath, int x, int y, bool visible) { m_filepath = filepath; m_rect.x = x; m_rect.y = y; m_visible = visible; m_image = IMG_Load(filepath); }


Reply With Quote