Is there any opportunity to make DefoldActivity
transparent in Android?
After I apply transparent theme it still stays black:
<!-- AndroidManifest.xml -->
<activity android:name="com.dynamo.android.DefoldActivity"
android:label="{{project.title}}"
android:configChanges="............"
android:theme="@style/Theme.Translucent"
android:screenOrientation="{{orientation-support}}"
android:exported="true"
android:launchMode="singleTask">
<!-- themes.xml -->
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="Theme.Translucent" parent="@style/Theme.AppCompat.Light.NoActionBar">
<item name="android:background">@android:color/transparent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
</style>
</resources>
Also I tried replacing default.render_script
with my custom render_script which has an empty update()
function but the activity is still black.
Changing Clear color
property at game.project
→ Render
to red (just for example) actually makes the activity red, despite having an absolutelly empty update()
function in the renderer (has no render.clear()
, render.draw()
, etc. calls).
As far I understand DefoldActivity
is transparent itself but it is filled with Clear color
that doesn’t have an alpha channel.
So the only option I see right now is to modify the Defold SDK
by adding EGL_ALPHA_SIZE 8
during the OpenGL initialization at android_util.c
Maybe someone knows how to do this without changing the Defold SDK?