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.

Topics - daverave1212

Pages: 1 2

I am using the "grow" block to flip an actor horizontally.

There are 2 issues I noticed:
- When the growing is finished, the animation stops
- The growing does not reach -100%

Here is a gif that shows exactly what happens:

Other mentions:
- I have no code/blocks in the actor
- I tried with other actors and the issue persists
- I tried changing the time from 1 second to other values (including 0) and the issue persists
- I tried changing the scaling from -100% to other values. It is fine for all positive values. For negative values, it seems to stop working at about -95%. I tried scaling it to -95% and it works fine. However, when I tried to scale it to -99%, the issue appeared.
  - It also seems to not work for any scaling below -100% (e.g. -200%). The scaling just stops at about -95%. Even if I scale it to -200%, it will scale the actor to -95% and stop there.
  - The same issue seems to happen with vertical scaling (e.g. scaling to w: 100%, h: -100%).

I don't know what else to try for this.
I have tried all I knew.
If anyone knows how I can fix this, please let me know.

Thank you!

Ask a Question / How to use a game scale larger than the screen size?
« on: November 16, 2021, 05:53:54 am »

I am trying to achieve a type of scaling for full screen.

My game height is 320 pixels.
My monitor size is 1080 pixels .

So, when in full screen ("no scaling"), the scale of the game is set to x3.

I would like to use an x4 scaling. In this case, the game would effectively go outside the screen, but that is fine.

Is there a way to do that?
Also if yes, is there a way to get the real screen size? AKA differentiate between the game screen size and the user's screen size?

Thank you!

Ask a Question / Actors appear as white boxes on Windows and HTML5
« on: April 23, 2021, 03:35:04 am »

I am trying to test my game. I ran it on Flash (Player), Android, HTML5 and Windows.
I also posted this on the Bugs subforum, in case it is a bug.

The game works fine on Flash (Player) and Android.
But on Windows and HTML5, there is a bug with actors. Some actors appear as white squares.

Here is what the game looks like in Flash (good):

Here is what the game looks like on Windows (glitched):

What is even stranger is that this seems to be a problem only on certain animations of the actors. Here's what I mean:

In this screenshot, the white box actor is the same actor as the guard with the torch, just different animations:

Note: All my assets are bound to the Main Atlas. This is my only Atlas.
Note: My Stencyl version is 4.0.4.

What I tried:
- I tried to enable/disable all atlases for all scenes.
- I tried to have the Main Atlas bound to all scenes.
- I tried to have the Main Atlas bound only to that scene in the screenshot.
- I cleaned up the project
- I checked the resources folder in the game folder and it looks fine. The assets folder in the games-generated folder in the windows folder also looks fine (for all sizes, e.g. x1, x1.5, x2, etc, the sprites seem to be there).
- I reinstalled Stencyl (latest version)

I don't know what else to try and I am starting to panic since I have been working on this project for months.

If anyone knows how to fix this or what might be the problem, I would really appreciate it, as it is a gamebreaking thing I don't know how to fix :(. I hope it's not a bug.

Thank you!

Ask a Question / How do you get a font by name?
« on: February 12, 2021, 07:46:01 am »

I am trying to get a font by name (e.g. "BigRedFont").

The usual way in the engine to do this is to use the
Code: [Select]
getFont(id) function, but that takes the font ID, not its name and that's not very helpful.

I saw this post ( about this topic which says to use the following code:

Code: [Select]
for (res in Data.get().resources)
   if (, Font) && == "Font Name Here")
       return cast (res, Font);       

return null;

However,  this does not work for me. It returns null.
So I went and printed (traced) the whole Data.get().resources object and I noticed that multiple of my fonts are missing from there.

My guess is that the fonts are not loaded yet in the scene, but I was out of luck browsing the Stencyl Haxe API for a solution.

Does anyone know a foolproof method to get a Font by its resource name?

Thanks a lot!

Ask a Question / Android compilation stops suddenly
« on: August 26, 2020, 01:55:27 pm »

I've been trying to compile a game for Android for testing purposes and I haven't managed to do it.
I created a new blank game with just a scene and an actor. No scripts, no extensions.

The game compiles and works if I build for Flash.
Once I swap for Android in the upper right corner, it shows "Compiling" for a few seconds, then stops and returns back to the game without any message on the screen or anything, and nothing else seems to happen.
I checked the logs but I can't really tell what's going on, though I think the game may have compiled.

If I remember correctly, I am supposed to see the "Sending to device" message after compilation.

I don't know what else to do.

Here are some useful specifications:
- I tried to reinstall Stencyl on another hard drive
- I tried to change the workspace folder to one with smaller path size (I saw online that it might fix it)
- I am on Windows 10, x64
- The phone attached to the computer is recognized by the computer and is a Samsung J5 with Android 8
- I am running Stencyl as administrator
- I gave the game a unique App ID (Game Settings > Mobile)
- The Android Minimum Version I use is API 14 - 4.0 (Ice Cream Sandwich)
- The Android Target Version is API 29 - Android 10
- I use JDK 12.0.2
- I have setup an Android certificate

I attached the logs below (probably the latest text file is the correct one). If someone can help me, I would be very grateful!

Ask a Question / How do you use the Game Controller feature?
« on: January 25, 2020, 06:13:21 pm »

I upgraded to the new version of Stencyl and noticed there's this new thing, Game Controller.
I can't figure out how to use it and I couldn't find anything useful online.

I see I can run Haxe code in the bottom half of the Script tab, but I don't seem to be able to interact with in game code.
Is there a way to set up custom commands or something, or modify variables on the fly?
What kind of scripts can I run?

Also, the log part; what is it for?

Thank you!

Ask a Question / Set image origin interacts weirdly with set X?
« on: December 23, 2018, 01:11:13 pm »
I made an image, then an image instance called 'img' and I set its origin to:

Code: [Select]
setOriginForImage(img, img.width/Engine.SCALE/2, img.height/Engine.SCALE/2);
I did this so I can rotate the image around its exact center with
Code: [Select]
img.rotation = img.rotation + 1;
Now, whenever i want to change the X coordinate of img, it behaves very strangely.
I put this code in an 'Every 0.02 seconds' loop:

Code: [Select]
setXForImage(img, img.x/Engine.SCALE + 1);

This drastically changes the X coordinate of img, not even close to 1.
It's X increases very fast, by  around the original width of the image / 2 + 1.
The rotation around the center works fine.

Am I doing something wrong?
Is this a bug?

Thank you!

Extensions / Camera Scroller Extension
« on: December 16, 2018, 07:46:32 am »

Camera Scroller
Works on iOS, Android, Flash, Windows and Mac.

Hello. This is my first extension and I hope it can be useful. Feedback is greatly appreciated.
Following the template:

Q: What does this extension do?
A: It allows for 'camera dragging' like you do with mobile pages on your phone. It is primarily intended for mobile apps, but should work on any platform. It has a smoothing effect and should feel natural to use.

Q: Why is it useful?
A: I haven't seen a similar extension and after I made it, it seemed quite nice to me.

- Camera scrolling by drag-and-dropping the screen
- Camera smoothing (it keeps moving for a bit after you finish scrolling
- Intuitive usage

Get it

- Download this Extension
- Sample Project

(How to Install and Update an Extension)


To use camera scrolling, you first need to Initialize it (only once per scene!).

Use this block to start the camera scrolling.
After using this block, you are good to go! Camera scrolling should be enabled.
You can choose which axis you want to scroll, Horizontally, Vertically, Both or none (you can change it later).
You can also choose if you want smoothing or not (you can change it later).

Disable/Enable Camera Drag
Use these blocks to enable or disable camera drag, on any axis.
NOTE: Do not use Initialize more than once per scene! If you want to enable or disable scrolling on any axis, use these blocks.

Disable/Enable Camera Smoothing
Enable or disable camera drag smoothing with this block. I think it's pretty straight forward.

Version History


Ask a Question / Is there a way to get larger code blocks?
« on: December 15, 2018, 06:48:57 am »
Hello! I've been struggling with the normal multi-line code blocks for a while, but they seem a bit too small for me.
It would be much more comfortable to have blocks of code that look like this:

Is there a way to increase their size/create custom ones that are bigger?
Thank you!

The code blocks always seem to small for me. I would like something like this:

Is this possible?

Thank you!

Hello! This is the second time I am asking this, but the first time I got no responses.

How can I get the behavior of an actor (not attributes or functions, but the behavior itself)?

For example, if I have a block for collision event with an actor which has a custom behavior called EnemyBehavior, I want to get that EnemyBehavior behavior as an object. The equivalent in unity would be GetComponent<EnemyBehavior>(), which returns the EnemyBehavior behavior of that actor.

The reason I want to do this is to more easily access functions and properties from other behaviors.
Is it possible?
Thank you for your time!

Ask a Question / Can I get the behavior of an actor by code?
« on: October 02, 2018, 03:20:18 pm »
How can I get the behavior of an actor (not attributes or functions, but the behavior itself)?
For example, if I have a block for collision event with an actor which has a custom behavior called EnemyBehavior, I want to get that EnemyBehaviorbehavior as an object. The equivalent in unity would be GetComponent<EnemyBehavior>(), which returns the EnemyBehavior behavior of that actor.

How can I do this? Thanks!

Ask a Question / [Solved] Why does this code work?
« on: June 06, 2018, 05:18:32 pm »
I am aware my question may sound odd, but it's 3 in the morning and I can't find an explanation online.

I made a class MyText in freeform mode and I made it extend a SceneScript.
I did it like that because I wanted it to act as a behavior too.
Then what I did, was give it a 'addWhenDrawingListener' to the constructor like this:
Code: [Select]
addWhenDrawingListener(null, function(g:G, x:Float, y:Float, list:Array<Dynamic>):Void {
g.drawString("Hello world");
Then I added a new MyText object in an arbitrary-code  (and called new MyText()) inside a newly created scene.
This actually drew me "Hello World" on the screen.

From my understanding, the whole code which is not from Behaviours for a scene (on update, on draw, when created, etc) are actually inside a 'default' behavior of the scene. Please correct me if I'm wrong here.
So, actually, what I did was I created a new behavior inside a behavior.
How does Stencyl know to use the same 'g : G' to draw the text?
I could create an on-draw block for my scene, the Stencyl automatically calls 'addBehavior(this on-draw block)' at initialization.
In that case it makes sense. But if I add a behavior "manually", how does it know to get the screen and draw on the same screen as the scene does?
Sorry if it sounds confusing.

Ask a Question / Actor disappears when I slide it?
« on: August 28, 2017, 04:07:08 pm »
Hello, I've encountered the following "bug" (maybe not a bug, but a feature i'm not aware of).
I have a scene. In the scene, I have 2 actors: a background image actor (because it is changeable) and another normal actor on another layer in front of the background image actor.
If I slide the normal actor in any way, it disappears. However, I've noticed that removing the background image actor fixes the issue.
Can anyone help?

Edit: to give more info on this, I've tried all eases (None, Normal In, etc) and this still happens.
I also tried sending the actor forward after and before the slides, no effect.
This happens even if the background image actor has 0% opacity.

I don't see any way to do this. I want to check on update if Actor1 is colliding with Actor 2. How can I do that?

Pages: 1 2