Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Justin

Pages: 1 2 3 ... 182
Ask a Question / Re: How do you accept android licences?
« on: Yesterday at 06:10:32 pm »
Download the appropriate archive for your OS:

Extract it. Go to extracted folder and open "bin". Open a terminal inside the bin folder.

Replace [STENCYLWORKS] in the following command with the path to your Stencyl workspace, then run it.

Code: [Select]
sdkmanager --sdk_root="[STENCYLWORKS]/android-sdk/android-sdk-windows" --licenses

The output should be like this. Just say yes to everything.
Code: [Select]
Warning: File C:\Users\Justin\.android\repositories.cfg could not be loaded.
6 of 6 SDK package licenses not accepted. 100% Computing updates...
Review licenses that have not been accepted (y/N)?

Ask a Question / Re: What does "Dynamic -> Void" mean in this context?
« on: April 14, 2019, 08:46:55 pm »
"Dynamic -> Void" is a Haxe type notation for a function that accepts any value and returns nothing. (Argument1Type -> Argument2Type -> Argument3Type -> ... -> ReturnType)

In this case, it's complaining because it wants a function (Dynamic->Void) and you're giving it something else (KeyboardEvent).

If you want to add and then remove an event listener, you need to set a variable to your function, and then pass that same variable to your add/remove event calls.

Code: [Select]
var someFunction = function(
    //do stuff
Engine.stage.addEventListener(, someFunction, false, 2);
Engine.stage.removeEventListener(, someFunction);

In your case, since you're trying to remove the event listener from within the function you're defining, you need the function to be available at a higher scope. For example, as a class field. At that point, you might as well just add a function to your class and use that instead.

(This needs to be in a "custom code" event from the advanced events list.)
Code: [Select]
private function someFunction(
    if(keyboardEvent.charCode == 13)
        Engine.stage.removeEventListener(, someFunction);
        _Response = _drawText;

When you want to add this function, just call this:
Code: [Select]
Engine.stage.addEventListener(, someFunction, false, 2);

Ask a Question / Re: XML Cannot Build Block (or something similar)
« on: April 12, 2019, 05:26:15 pm »
Can't say anything without logs. If the problem is recent enough, perhaps you still have the logs from it. If you remember what day it happened, you can peek through your logs folder and take a look at logs from that day.

It's benign, no need to worry about it.

Ask a Question / Re: Help - iOS crash related to getFontHeight()
« on: April 09, 2019, 02:28:23 am »
Ah, sorry, I presumed it was already enabled for you. It should be enabled by default, but perhaps it's not behaving as expected.

Ask a Question / Re: Help - iOS crash related to getFontHeight()
« on: April 08, 2019, 07:38:26 pm »
Look at a few more lines from what you labeled as "crashes at" for a better idea. Copy it and paste it over if you're unsure.

Alternatively, you can also get something that maps more directly to the Haxe code by running the game in debug mode.

1. Ensure that "Run > View logs through game controller" is checked.
2. Run > Run App in Debug Mode (iOS).
3. Click "Game Controller" in the top bar, and go to the "logs" tab.

When the game would normally have crashed, it may or may not continue to crash in debug mode, but it should also print an error in the log. Click the error for more details in the bottom pane, and then you can click the blue links in that pane to see what code you're using, or what code from the Stencyl engine, is causing the problem.

Drawing used to be hardware accelerated on non-Flash platforms, using a specially written C++ rendering pipeline. Now it's not (except in a few rare cases, like just drawing a rectangle). This change was made on OpenFL's side around 4 years ago in order to unify more code under a single codebase. The manually coded hardware-accelerated graphics were dropped in favor of the Cairo library, which has better parity with what's possible with the Flash API, but unfortunately, it's all done in software (using CPU, not GPU).

This was one part of a general movement on OpenFL's side to unify all the code for different platforms in a single codebase. While this transition was happening, there was the possibility to use OpenFL's "legacy" mode or "next" mode. Stencyl stuck with legacy mode for as long as that choice was available, due to various issues with "next".

It was still possible to access the old, hardware accelerated code, until OpenFL 4 was released. The Stencyl 3 release line was the last that included that legacy code.

In the first link, you can see that Cairo was touted as "faster" and "more accurate" than the hardware renderer. That's likely true in some cases, but given the blocks available in Stencyl, that's not likely to hold for the use cases of most of our users. However, the best I could do to increase drawing performance without breaking the API was to cache the drawing from the previous frame.

If the drawing doesn't change each frame, it doesn't need to be re-drawn. If the drawing changes each frame (a vignette that closes and opens on a scene, for example), it needs to be redrawn every frame.

Cairo does have an OpenGL backend (meaning it would be hardware accelerated), but for various reasons, that's never been deeply looked into on OpenFL's side. It's possible that if that path opens up, we may be able to regain some of the lost performance. Until then, if you can somehow recreate your effects using actors, the Image API, or shaders, the performance should be better.

Yeah, the first link I posted in this thread is the Haxe manual. Here's the main page.

From there, you can also click on "Learn Haxe" in the top menu bar for more content.

Oh, I see, the problem is you don't want a hardcoded name. You want a name passed in through a variable. In that case, you can use reflection.

Code: [Select]
function jsonReturnValuesForKey(myKeyValue:String, myJSONString:String){
    var json = haxe.Json.parse(myJSONString);
    return Reflect.field(json, myKeyValue);

Can you post your example code? It would help to understand exactly what you need. If you're using haxe.Json, you should be able to use dot access.

Ask a Question / Re: How to call en event from an extension
« on: March 23, 2019, 02:25:11 am »
At the top of your Haxe file, among the other imports, include this line.

Code: [Select]
import com.stencyl.behavior.Script.*;

If that doesn't do the trick, or you're confused about it, please provide more details.

Ask a Question / Re: How do you upgrade to Java JDK8?
« on: March 23, 2019, 02:22:47 am »
Try this
Code: [Select]

Ask a Question / Re: How do you upgrade to Java JDK8?
« on: March 22, 2019, 06:30:47 pm »
What chooser? In Preferences > Tools?

Ask a Question / Re: Cant test android apps on free version
« on: March 21, 2019, 05:33:21 pm »
Please make a thread in the issue tracker. I'll look into how to manually bypass this until we can include an update in Stencyl.

Pages: 1 2 3 ... 182