Page 1 of 1

Experiments for future HMGSCRIPT versions...

Posted: Mon Dec 22, 2014 3:29 am
by Roberto Lopez
Hi All,

Instead of using pixels to define position and (in some cases) size of GUI objects, we could use relative units, as seen on this table (from w3schools: http://www.w3schools.com/cssref/css_units.asp):
Unit Description
em Relative to the font-size of the element (2em means 2 times the size of the current font) Try it
ex Relative to the x-height of the current font (rarely used) Try it
ch Relative to width of the "0" (zero)
rem Relative to font-size of the root element
vw Relative to 1% of the width of the viewport
vh Relative to 1% of the height of the viewport
vmin Relative to 1% of viewport's smaller dimension
vmax Relative to 1% of viewport's larger dimension
%
px pixels (1px = 1/96th of 1in)
Meaning that we could make our GUIs automatically adjust to screen sizes or similar criteria.

This, eventually, could allow us to use an unique interface for mobile and desktop (this idea must be tested and adjusted)

For this, the library should be modified to accept string as coordinates and sizes, in such way to work like that:

Code: Select all

	oMain = new Form( "HMGSCRIPT Main Demo (Desktop Style)", '90%' , '90%' );
To be tested...

Re: Experiments for future HMGSCRIPT versions...

Posted: Mon Dec 22, 2014 9:49 am
by serge_girard
This would be great !

Serge