2017년 6월 30일 금요일

gathering screens dimensions into global variables


Well, I think that the title is clear enough !

Because the shape that is displayed on my tablet is a bit far what I planned to set, I just think that all is matter of designing in term of % of width & height. therefore my question
Is it possible to capture the screen dims
Tried global(XMAX)=screen1.width
assuming that XMAX is my global variable.
It fails with a warning....
any help ?

--
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.
Also it would help to tell us, which warning you got...

--
For some reason I didn't get an alert about your answer therefore my late reply. Sorry about that.

I'm working to create specific apps for Autistic kids within a charity action. 
The requirements are set by the teachers & professionals.
I put some screenshots to show how I'm progressing. It's about allowing kids to move cards (for the moment they're only icons, in the real word they will be real pictures of family members) according to a temporal axis (see the red arrow). In practice, if the kid put a Grand ma picture somewhere, he/she will not be able to move another card (but Grand pa) on the left.
The issue I had is getting a playboard that works with all kind of devices (in term of size). How to capture that information ?
To do so I requested help from the community. Meanwhile I tried an option that looks ok.
I captured the width & Height from the screen attributes and put them in global variables. The dimensions of all the items in the screen are tentaively percentage of those dimensions.

It looks naive therefore if my approach is not that correct, please advise. Especially because it requires me to compute the relative position of a sprite of the 6 members. 



--
there is a timing issue, because of that you can't get the screen width and height in the Screen Initialize event. Instead use a clock component, start the clock in the Screen Initialize event to get the width and height a few milliseconds later in the Clock.Timer event

--

댓글 없음:

댓글 쓰기