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
16
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.
Thanks

17
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.

18
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?

19
Ask a Question / How do i get date and time?
« on: May 15, 2014, 11:41:43 am »
I've seen quite some tutorials on this but none was helpful :( i don't understand how to get them working. They either refer to some downloads with no download links or other things. I worked in scratch and other gui programs and i know the basics. As i understand, the get time and date thing is supposed to be a custom block which i don't know how to use, neither have i found any tutorial that explains it well enough.
So if you could explain step by step how to get date and time?
Thanks!
PS: I'm taking about android!

Pages: 1 2