Skip to first unread message
Assigned to halab...@google.com by taifu...@gmail.com

Barbara Walters

unread,
Nov 30, 2014, 1:20:10 PM11/30/14
to mitappinv...@googlegroups.com
I tried to set an imagesprite to have height set to fill parent and width automatic, but the size seems to be automatic for both height and width.

Here is a summary of the settings:

the screen is set to portrait, not scrollable.
The canvas is set to fill parent for both height and width.
The imagesprite has x and y set to 0, height to fill parent and width to automatic. 

The sprite appears in the correct position, but isn't sized correctly.

I've had issues sizing components and saw that there were hints to enable a timer in screen initialize because a delay may be needed to allow the components to size correctly. I tried adding code to set the sizes again programatically because the properties didn't seem to be working. I set the timer interval to 1 second and catch the timer event. Then I set the imagesprite's height to -2 and width to -1, but it still seems to have no effect. 

Does fill parent work for image sprites?

Thanks!

Ghica

unread,
Dec 1, 2014, 7:31:15 AM12/1/14
to mitappinv...@googlegroups.com
What you could do, is set the height of the image sprite to be the screen height during initialization. Be aware though, if you want the width to stay in proportion, you have to calculate what it should be, because AI2 does not keep image proportions.
Cheers, Ghica.

Barbara Walters

unread,
Dec 1, 2014, 9:31:12 AM12/1/14
to mitappinv...@googlegroups.com
Yes, I understand how I could do that; set height and width to automatic and then do the calculation. But I'm teaching programming with middle school students and would like to use the facilities that are available in app inventor and have an explanation on why this isn't working. Should the fill parent option work or is this a bug? 

Thanks so much!

Ghica

unread,
Dec 1, 2014, 4:36:58 PM12/1/14
to mitappinv...@googlegroups.com
Hi Barbara,
My apologies. Do you have a simple .aia that I can look at?
Maybe it is a bug, but i would like to check in the next release, which is all about screen sizes and so on.
Cheers, Ghica

Ghica

unread,
Dec 2, 2014, 2:19:43 AM12/2/14
to mitappinv...@googlegroups.com
Please post it to the forum, then also someone else could have a look at it.
Cheers, Ghica

Ghica

unread,
Dec 3, 2014, 2:38:03 PM12/3/14
to mitappinv...@googlegroups.com
Hi Barbara,
I had a project with the same problem, and at MIT they acknowledged that it is a bug. It will be fixed in a next release. Thanks for posting it.
Cheers, Ghica.
Reply all
Reply to author
Forward
0 new messages