Torque2D on Patreon

2D version of the Torque engine.

Moderator: marauder2k9

  • 1
  • 3
  • 4
  • 5
  • 6
  • 7
63 posts Page 5 of 7
marauder2k9
Posts: 315
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Wed Aug 28, 2019 5:01 pm
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
marauder2k9
Posts: 315
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Wed Aug 28, 2019 8:58 pm
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
marauder2k9
Posts: 315
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Thu Aug 29, 2019 2:39 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

google()

like this

Code: Select all

allprojects { repositories { google() jcenter() } }
and then it will build without errors Torque 2d 3.4
marauder2k9
Posts: 315
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Thu Aug 29, 2019 3:34 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
then in build.gradle in android studio add
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.
marauder2k9
Posts: 315
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Sun Sep 01, 2019 9:11 pm
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
marauder2k9
Posts: 315
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Sun Sep 01, 2019 10:07 pm
Got admob working!! :D at least for interstitial ads ad gameover sections
marauder2k9
Posts: 315
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Sun Sep 01, 2019 10:50 pm
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
marauder2k9
Posts: 315
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Wed Sep 04, 2019 5:02 am
im an idiot, seems setting active abi to armeabi-v7a the error no longer comes up and audio works fine lol
marauder2k9
Posts: 315
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Wed Sep 04, 2019 12:54 pm
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?
marauder2k9
Posts: 315
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Wed Sep 04, 2019 6:23 pm
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
63 posts Page 5 of 7

Who is online

Users browsing this forum: No registered users and 2 guests