### Torque2D on Patreon

2D version of the Torque engine.

Moderator: marauder2k9

• 1
• 3
• 4
• 5
• 6
• 7

#### Re: Torque2D on Patreon

marauder2k9
Posts: 371
Joined: Wed Feb 18, 2015 7:36 am
well i just use it to display ads, but u can use the same sdk for purchases in game like microtransactons or rewarded video views

#### Re: Torque2D on Patreon

marauder2k9
Posts: 371
Joined: Wed Feb 18, 2015 7:36 am
was also thinking, do u think there would be much use for a torque 2d udemy class?

Developers would like a 2d game development engine that supports both platforms that isnt unity lol

#### Re: Torque2D on Patreon

marauder2k9
Posts: 371
Joined: Wed Feb 18, 2015 7:36 am
oh just a heads up about developing in android studio, a lot of the errors that were coming up android studio fixed itself but one error in particular was linked to aapt2 and android studio couldnt fix it because it couldnt find the right files, they have been moved to googles maven repository so in the build.gradle file under all projects you have to add

like this

Code: Select all

allprojects { repositories { google() jcenter() } } 
and then it will build without errors Torque 2d 3.4

#### Re: Torque2D on Patreon

marauder2k9
Posts: 371
Joined: Wed Feb 18, 2015 7:36 am
other things that may have contributed to it working

in the android studio directory, make a gradle.properties file and have this line in it:
org.gradle.jvmargs=-Xmx2g -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
dexOptions {
javaMaxHeapSize = "4G"

} 
just after android{

the only thing i cant seem to get working in the emulator is the audio, i havent tested it on a device yet but i think it may just be the emulator will have to wait until i can get my hands on a phone to see.
Last edited by marauder2k9 on Thu Sep 05, 2019 10:59 am, edited 1 time in total.

#### Re: Torque2D on Patreon

marauder2k9
Posts: 371
Joined: Wed Feb 18, 2015 7:36 am
Think ive found at least a pointer to the audio problem,

2019-09-01 20:10:13.417 17891-17912/com.garagegames.torque2d E/libOpenSLES: Cannot create audio player: unsupported byte order 1

Something to do with not being set to little_endian properly

#### Re: Torque2D on Patreon

marauder2k9
Posts: 371
Joined: Wed Feb 18, 2015 7:36 am

#### Re: Torque2D on Patreon

marauder2k9
Posts: 371
Joined: Wed Feb 18, 2015 7:36 am
Also on the audio front, the error 2019-09-01 20:10:13.417 17891-17912/com.garagegames.torque2d E/libOpenSLES: Cannot create audio player: unsupported byte order 1

seems it only happens on API 27 devices (ive tested 2 so far) API 28 devices seem to not show up this problem, even though both devices seem to be x86

#### Re: Torque2D on Patreon

marauder2k9
Posts: 371
Joined: Wed Feb 18, 2015 7:36 am
im an idiot, seems setting active abi to armeabi-v7a the error no longer comes up and audio works fine lol

#### Re: Torque2D on Patreon

marauder2k9
Posts: 371
Joined: Wed Feb 18, 2015 7:36 am
do u know of any way to update the text value of a textsprite dynamically? I have been using guitextctrl for updating score and lives but i want to use a custom font that i made in angelcode, is there any way of adding a bitmap font to a guitextctrl?

#### Re: Torque2D on Patreon

marauder2k9
Posts: 371
Joined: Wed Feb 18, 2015 7:36 am
Got it figured out for anyone in future this is how i did it:
function MyModule::createLives()

{

%livesText = new TextSprite()

{
Scene = MyScene;
Font = "myModule:TifaxFont";
Position = "0 -1.8";
FontSize = 15;
OverflowModeY = "Visible";
OverflowModeX = "Visible";
BlendColor = "1 1 1 1";
TextAlignment = "center";
TextVAlignment = "Middle";
Class = "LivesText";
UpdateCallback = true;
};
}
function LivesText::onUpdate(%this)
{
%this.Text = \$lives;
}
• 1
• 3
• 4
• 5
• 6
• 7

#### Who is online

Users browsing this forum: No registered users and 3 guests