Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Soda and iPhone (different screen sizes)

Hi @yojimbo2000 . Sorry to bother again. But as I my question is about Soda, I think you could help me easily. Anyway, I wrote an app that works fairly fine in my iPad using Soda (I still get a 3/4 of the screen darkened while showing an alert message box), but when I export to xcode and run in an iPhone, I see all the buttons and dialog boxes in the wrong place. I thought working with float numbers would solve that, but it seems not. So, for example.

Soda.Alert{ --an alert box with a single button
title = "Alert",
content = "Not for Medical usage.",
y=0.6, h = 0.3, w=0.5,
substyle={"warning"},
-- blurred = true,
}

Works fine in iPad, but completely wrong in iPhone.
or the following button

Soda.Button{

title = "Cam", 
subStyle = {"translucent"}, --style = Soda.style.warning, 
x = -0.2, y = 0.11, w = 0.15, h = 0.07, 
callback = 
    function()
    if camlen==2 then 
        camlen =1
     else
        camlen=2  
    end

end

}  

Am I missing something? Thanks a lot!

Comments

  • Posts: 815

    Because iPhones have another amount of pixels to WIDTH and HEIGHT. - Use this two values with big letters to specify the amount per WIDTH

  • Posts: 2,020

    @aamato universal support was on the roadmap for Soda, but I didn't get very far with it, mainly because doing iterative development targeting the iPhone with Codea is so much hassle. I believe Codea is getting universal support at some point in the future (if you follow the Codea commits twitter account, there seems to be a lot of activity around that), which would make developing universal apps in Codea a lot more viable.

    A couple of things. First, you're right that floating point should work, at least for the size and layout of the frames. What could be throwing it off is font sizes (which Soda doesn't automatically scale). If you could post screenshots of how it looks on iPad vs iPhone that'd be really helpful (the forum "post a screenshot" function doesn't work, you have to host the image somewhere public, GitHub, imgur, Wordpress etc then link to it with the markdown inline image notation ![caption](www.linktomyimage.com)).

    The other thing to point out though, is that just scaling an interface down for iPhone rarely works that well. It'd be too cramped, button sizes too small to tap accurately, text too hard to read etc. You'd be better off designing 2 separate interfaces, one for iPad, one for iPhone, and then switching between them depending on the screen size that Codea reports.

  • edited October 2016 Posts: 2,020

    @aamato the property Soda.baseFontSize (defaults to 20) can be used to scale the font sizes used across Soda.

    Also, you're welcome to post these queries in the main Soda thread. It might make it easier for others who have the same issues to find them.

  • Posts: 13

    I am studying solutions for that, I will return here soon. Thanks

Sign In or Register to comment.