This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-08-22 18:42:08

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Exit presentation mode block

How would I make one?

The code to enter presentation mode is:

Code:

enterPresMode
    | t1 |
    t1 _ self ownerThatIsA: ScratchFrameMorph.
    t1 ifNotNil: [t1 enterPresentationMode]

How would I make code for exit presentation mode?
I've already tried the following:

Code:

exitPresMode
    | t1 |
    t1 _ self ownerThatIsA: ScratchPresenterMorph.
    t1 ifNotNil: [t1 exitPresentation]

Code:

exitPresMode
    | t1 |
    t1 _ self ownerThatIsA: ScratchFrameMorph.
    t1 ifNotNil: [t1 exitPresentationMode]

http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#2 2012-08-23 07:25:13

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Exit presentation mode block

When you're in full screen mode, I don't think the ScratchFrameMorph owns the sprites any more (although I might be wrong). To access the SFM, you need to do something along the lines of "t1 _ (self ownerThatIsA: OffscreenWorldMorph) frame.".

Sorry for being a bit vague, but I haven't done anything like this in a while.


/* No comment */

Offline

 

#3 2012-08-23 08:19:03

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Exit presentation mode block

TheSuccessor wrote:

When you're in full screen mode, I don't think the ScratchFrameMorph owns the sprites any more (although I might be wrong). To access the SFM, you need to do something along the lines of "t1 _ (self ownerThatIsA: OffscreenWorldMorph) frame.".

Sorry for being a bit vague, but I haven't done anything like this in a while.

You're right though.
However, the actual presentation mode morph has its own method to exit the mode. Maybe just look that one up and use the ownerThatIsA to point to the PresentationModeMorph or whatever it's called  tongue

Offline

 

#4 2012-08-23 08:27:58

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Exit presentation mode block

(self ownerThatIsA: ScratchPresenterMorph) exitPresentation


/* No comment */

Offline

 

#5 2012-08-23 12:48:40

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Exit presentation mode block

TheSuccessor wrote:

(self ownerThatIsA: ScratchPresenterMorph) exitPresentation

Doesn't work.  sad


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#6 2012-08-23 13:13:00

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Exit presentation mode block

Solved, you're welcome.

Offline

 

#7 2012-08-23 13:30:45

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: Exit presentation mode block

jvvg wrote:

TheSuccessor wrote:

(self ownerThatIsA: ScratchPresenterMorph) exitPresentation

Doesn't work.  sad

You ARE running from inside presentation mode, right? xD


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#8 2012-08-23 13:52:55

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Exit presentation mode block

MathWizz wrote:

jvvg wrote:

TheSuccessor wrote:

(self ownerThatIsA: ScratchPresenterMorph) exitPresentation

Doesn't work.  sad

You ARE running from inside presentation mode, right? xD

Yeah, but that didn't work anyway. We finally figured out this code that works:

(self ownerThatIsA: OffscreenWorldMorph) frame exitPresentationMode.

Offline

 

#9 2012-08-23 14:19:48

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Exit presentation mode block

Yeah, LS's code works and has been applied. See this Insanity changeset.


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

Board footer