TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
FORUMS
CHAT
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
Suggestion Archives
→
Completed
→
Draw onto a specific layer
Pages:
1
2
Draw onto a specific layer
Alexin
Posts: 3127
May 10, 2011, 07:26:21 am
The article is available under Coding / API.
Regarding the snippets of code, the tab size should be bigger and it could use an horizontal scrollbar.
"Find the fun"
alexin@stencyl.com
Jon
Posts: 17524
May 10, 2011, 08:44:47 am
The links to scenescript mentions link to the API index but not the specific class page.
Alexin
Posts: 3127
May 10, 2011, 09:25:15 am
Oh right, I forgot to ask about this. I don't know how to obtain the exact URL. The browser's address bar shows always the same URL. Feel free to edit the article if you know how to get the correct URL (and let me know).
"Find the fun"
alexin@stencyl.com
Greg
Posts: 1259
May 10, 2011, 09:39:13 am
If you click on the "No Frames" link at the top, it should show the full URL -
http://api.stencyl.com/as3/stencyl/api/engine/behavior/SceneScript.html
greg@stencyl.com
Alexin
Posts: 3127
May 10, 2011, 09:52:09 am
Thank you, Greg.
I'm going to edit the article.
"Find the fun"
alexin@stencyl.com
MrDumle
Posts: 116
September 07, 2011, 05:13:13 am
Sorry to bring this up again. Just wondering where how to use this script in DM mode.
coleislazy
Posts: 2607
September 07, 2011, 05:40:45 am
It is trickier in Design Mode. You have to use some code and "trick" SW into inserting an extra function.
In the example below, I use a closing } to make SW think the "when drawing" function was done, then inserted Alexin's function below it. The explanation for how this function works is
here
. SW will automatically put another } at the end of the wrapper, so I had to omit the one from the example. I also broke the lines up in the screenshot so they could be read. You probably don't want to do that when you actually use this.
MrDumle
Posts: 116
September 08, 2011, 09:41:47 am
That is very helpful, thank you. It feels like that will come in handy in the future.
Quote
" I also broke the lines up in the screenshot so they could be read. "
I guess you mean that you used two code blocks when you could have used one, am I right?
coleislazy
Posts: 2607
September 08, 2011, 10:01:07 am
No, I mean that I broke up the function definition and the drawString arugment onto two lines each so that it wouldn't be cut off in the screen shot (since the box does not resize).
But, yes, I could have simply used one code block.
MrDumle
Posts: 116
September 08, 2011, 02:45:31 pm
oh, of course, how stupid of me.
Pages:
1
2