Bowarc / chess_game

A multiplayer chess game made with ggez
1 stars 1 forks source link

Better ui positioning #40

Open Bowarc opened 11 months ago

Bowarc commented 11 months ago

Text, for example, are currently placed by their center, which is bad for clean ui.

A solution could be to add a setting for using the position as center or topleft etc..

Or just use the Rect struct idea, you just could make the given pos its center or the topleft etc..

IMPORTANT: as the size of the text is dynamic, if you set xy to it's topleft by sub it's size * 0.5 it wiuld fuck up when changing the size.

So if you use new_from_center and save the topleft, it's fucked and if you use new_from_topleft and store the center it's also fucked, maybe an enum to know what pos was used as a field of Rect? Seems the best option