Hi,
I'm somewhat of a beginner in both wxWidgets and SFML but here goes:
I'm making a level editor and have made a small part of it that scans a directory for tilesets and then shows one of them in a wxWindow. Problem is, whenever I change the tile graphics it gets stretched (see attachment).
The tiles are supposed to be 32x24 pixels. The stretch happen after calling SetClientSize in this function:
void MyPalette::pickTileset(int num) {
if(num<tileset_max && num>=0) {
tileset_n = num;
int w, h;
w = myTilesets[num].getSize().x;
h = myTilesets[num].getSize().y;
cols = (w+width-1)/width;
rows = (h+height-1)/height;
cells = cols*rows;
wxWindow::SetClientSize(wxSize(w, h));
wxScrolledWindow* par = (wxScrolledWindow*) GetParent();
//if(par!=0) par->SetScrollbars(1, 1, event.GetSize().x, event.GetSize().y);
}
}
(initial size is 800x600 which looks fine)
[attachment deleted by admin]