MKelm / mct

"Mass Control Tycoon" a GPL game for Windows, Mac and Linux
Other
5 stars 1 forks source link

More about user interface / graphics #43

Open MKelm opened 11 years ago

MKelm commented 11 years ago

The last graphics issue is here: https://github.com/mctteam/mct/issues/18

Before the 2nd pre-alpha release today, I began already to implement some new logic to show scenes / display objects. The scenes will be connected with layout objects which are part of element objects, layout objects depend on a grid object which depends on the element and so on ...

A derivation of the base layout class can be used later for UI and a new layout handling for a new DisplayWindow class and so on ...

But first I want to improve the planet layout / grid output more ...

MKelm commented 11 years ago

I have added the first implementation of the paint tool, it is just a single file (lib/display/paint.html) yet, but offers the possibility to draw and save png images which can be used later for in-game graphics, in relation to https://github.com/mctteam/mct/issues/22 an simple web database connection might be relative convenient to enrich the game contents ... the current default size of the drawing area is 450x450 which might be enough, depending on the gfx type the output image needs related meta data, like the scale value, e.g. if it is a product image and should fit in the products catalog view.

MKelm commented 11 years ago

The game uses new files only now, these are the framework classes and ~3 new files for global stuff.

The framework has got the first UI layout / element class for the menu and with some display objects, like logo, title and buttons. But no interactions yet.

The handling of display text styles and translations has changed, the new data folder contains styles / translation data for each game element (class) and the related data can contain externals data to use general stuff from one source data file in all related elements.

MKelm commented 11 years ago

FPS counter and surveys are back, and the new display logic supports correct resize of all elements now.

MKelm commented 11 years ago

The UI has a better layout class now, which supports frames and the calculate method set positions / part sizes depending on parts' display objects size, align and padding values. The window panel element class uses these features to set ui windows, like with the old window builder, but without fixed window size. The most window builder features have been re-implemented with an approach for multiple layers support, but the cross-layer action support and list contents are not included yet. The dynamic texts have a full translation support now, but dynamic elements and special text placeholders are not included yet too.

MKelm commented 11 years ago

The text objects uses the PIXI word wrap solution now, which needs a fixed max width for the text object. The initial version had some bugs, I added corrections to PIXI.js to get a word wrap behaviour like before. But the max width for text objects is better than a max character length for each line, like before. The max length values are part of the styles configuration currently, but it might be better that they will be located e.g. in the window configuration, because when a content contains a list, the max width of text depends on the max amount of columns and so on.