Questions from corona sdk developer

hi everyone, i’m corona sdk developer and I’ve been following Defold for two years. i’ll make a html5 game so i decided to learn defold. Because, Defold uses Lua and King is very reliable organization. (sorry for my poor english)

These are my questions:

1-in corona sdk you have one code and you can build it to multiple platforms. is this possible in Defold.

for example:

if platform=="android" then
  IAPfunctionForAndroid()
elseif platform=="ios" then
  IAPfunctionForIOS()
end

2-corona sdk have dynamic content scaling feature. So you can build your application for any devices and any resolutions.
for example : if you have an enemy image somethink like “enemy.png”. you should have “enemy@2.png” and/or “enemy@4.png” for higher resolutions. Corona sdk can use these files automatically. is this possible in defold?

thanks in advance.

1 Like

Here you can see instructions for how to check what OS is being used

sysinfo = sys.get_sys_info()
twitter = {}

if sysinfo.system_name == "Android" then

end
1 Like

Welcome to the forum @karagozkenan! In Defold you also publish to multiple platforms from a single code base, and when it comes to in-app purchases as in your example you would have a single code path with a call to iap.buy() to buy from Apple/Google/Amazon and Facebook. There is no need to handle purchases differently between the platforms. The engine will take care of the details for you.

BUT, with that said, you can call sys.get_sys_info() to get a Lua table back with system specifics, such as OS, model, language and so on.

Defold doesn’t have support for dynamic content and automatically picking the correct version of an image based on screen resolution. This is discussed in multiple forum threads, and some solutions are suggested, for instance this one. We will implement a system similar to what you have in Corona, but I’m not sure when.

3 Likes

thanks for your answers. I will use high res. images for now. this is not a big problem for me. :slight_smile:

2 Likes