Hi,
We have single Resources folder for all platforms.
So how do you guys manage platform dependent resource?
Like audio, textures, etc.?
Currently i am replacing resources, while i change platform.
I want to know diff solutions.
thanks.
Hi,
We have single Resources folder for all platforms.
So how do you guys manage platform dependent resource?
Like audio, textures, etc.?
Currently i am replacing resources, while i change platform.
I want to know diff solutions.
thanks.
Personally I don’t have different resources for different platforms.
But if I did, I would use a folder structure…
Resources
- Images
-- genericImage.png
-- Windows
---- Flower.png
-- IOS
---- Flower.png
-- Android
---- Flower.png
Then use
#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
searchPaths.push_back("Images/Android");
#endif
for each platform.
Obviously only adding the platform specific directories to the platform specific projects.
Thats what i want to get rid off.
So, you want tio include platform specific resources without including platform specific resources?
Honestly, I thing you either didn’t understand my post, or I didn’t understand your requirements.
I assumed you wanted to be able to inlclude one resource in the IOS app and another (for the same purpose) in the Android app.
What I proposed will handle that, while only including the platform specific resources in the application.
so I must have misunderstood.
Perhaps you could explain exactly what you want to achieve?
No, you understand me right. But how to achieve that in a simple way.
How to do that?
Suppose i have project called ABC ready with few common resources and few platform dependent, Now i want to configure such a way that, when i deploy for ios after that i should deploy for android too without changing in resource dir.
Hope this clears ![]()
The way i do it is i have for example three folders
-Resources
– common ( all common resources for both ios and android)
– ios
– android
In xcode i only include common and ios, and in build.gradle i only include android and common. Search paths stays the same. So basically build system is responsible for copying correct resources, and code stays the same.
I decided to package the minimal set of images inside the build and download at runtime the rest from my server.
Good: When the user starts the app, I can analyze the resolution and check on my server the best fitting one
Bad: If the app reach a great number of downloads you can suffer the server bandwidth
I don’t follow how you are deploying? Are you not building the IOS App with Xcode and the Android app with something else?
I use Xcode for programming and generating iOS builds, and cocos console to make Android builds. Since Android is not my forte, I don’t want to mess with that process much, so I use the Resources folder as the common and Android specific assets (in a directory next to “res”), and then I have a separate Resources-iOS directory that I add the content of by reference to the Xcode project, in the “Resources” group.
For example:
Resources/
– fonts/
– res/
– audio/ (contains the Android OGG files)
Resources-iOS/
– audio/ (contains the iOS MP3 files)