Hello! I had an idea for 2 reporter blocks that would allow you to define the Mouse X and Y.
So I looked in Scratch-UI-Panes - ScratchFrameMorph - other. There was the code for the little mouseX and mouseY thing in the corner of the project viewer thing.
But the code was only this:
^ workPane mouseX
And
^ workPane mouseY
I suppose that means its using something called "workPane" that doesn't exist in the 'block code' area, because when I use it and try to except, it asks me to define it.
So, any help?
Offline
workPane in ScratchFrameMorph is a variable that is for the ScratchStageMorph (the stage). If you try using it outside the ScratchFrameMorph class you're going to get an error. You're going to have to see if the "block code area" has a reference to ScratchFrameMorph which you can then get workPane. Or the "block code area" already has a reference to workPane, I haven't really looked though.
Offline
wcfs96 wrote:
workPane in ScratchFrameMorph is a variable that is for the ScratchStageMorph (the stage). If you try using it outside the ScratchFrameMorph class you're going to get an error. You're going to have to see if the "block code area" has a reference to ScratchFrameMorph which you can then get workPane. Or the "block code area" already has a reference to workPane, I haven't really looked though.
Okay.
How do you reference?
Last edited by ProgrammingFreak (2011-04-09 13:04:18)
Offline
I do believe workPane is the stage... this means that there's no need to access anything, just look in the stage for these two methods. they'll have a bunch of code which is (hopefully) transportable outside that class.
Offline
LS97 wrote:
I do believe workPane is the stage... this means that there's no need to access anything, just look in the stage for these two methods. they'll have a bunch of code which is (hopefully) transportable outside that class.
Okay! Thank you!
In the stage in UI-Panes?
Last edited by ProgrammingFreak (2011-04-09 13:15:23)
Offline
ProgrammingFreak wrote:
LS97 wrote:
I do believe workPane is the stage... this means that there's no need to access anything, just look in the stage for these two methods. they'll have a bunch of code which is (hopefully) transportable outside that class.
Okay! Thank you!
![]()
In the stage in UI-Panes?
The ScratchStageMorph
Offline
LS97 wrote:
ProgrammingFreak wrote:
LS97 wrote:
I do believe workPane is the stage... this means that there's no need to access anything, just look in the stage for these two methods. they'll have a bunch of code which is (hopefully) transportable outside that class.
Okay! Thank you!
![]()
In the stage in UI-Panes?
![]()
The ScratchStageMorph
Oh. Lol. In Objects, yes. *blush*
Offline
Are the <x position> and <y position> blocks for the sprite or mouse?
Offline
Oh no. I just remembered. Sensing already has a block like this!
<mouse x><mouse y>
Offline
wcfs96 wrote:
x position & y position are for the sprite coordinates. mouse x & mouse y are for the mouse coordinates
What class are you trying to reference the stage from?
Doesn't matter now, does it?
Offline
ProgrammingFreak wrote:
LS97 wrote:
I do believe workPane is the stage... this means that there's no need to access anything, just look in the stage for these two methods. they'll have a bunch of code which is (hopefully) transportable outside that class.
Okay! Thank you!
![]()
In the stage in UI-Panes?
Somewhere in there. I cannot find it, I thought it was presenter, but it isn't. Oh, okay, its under ScriptableScratchMorph,
silly us. LOL
Offline
ProgrammingFreak wrote:
Oh no. I just remembered. Sensing already has a block like this!
![]()
<mouse x><mouse y>
Oh... I thought you were making a separate block! LOL
Offline
ProgrammingFreak wrote:
Oh no. I just remembered. Sensing already has a block like this!
![]()
<mouse x><mouse y>[/blocks]
LOL. I was wondering what this was for.
Offline
Yeah. I was wanting to but it doesn't matter.
Offline