Community
SCI Programming => SCI Syntax Help => Topic started by: MusicallyInspired on June 05, 2007, 01:56:09 PM
-
Is it possible to hide a display of words after a certain amount of cycles like you can with a view or is it maybe possible to wipe all displays on the screen if that's not possible?
-
Is it possible to hide a display of words after a certain amount of cycles like you can with a view or is it maybe possible to wipe all displays on the screen if that's not possible?
Yes, it's possible. You need to use the dsSAVEPIXELS and dsRESTOREPIXELS arguments to Display(). You can see how in my Keypad class - that class also demonstrates another trick that may be relevant to you: You can call Animate() with appropriate arguments to force a redraw of the screen.
-
Nice. How then exactly do I implement those?
Also, I'm trying to hide the cursour as soon as the title screen appears until a certain case. I can't seem to find the code for that either.
-
First, you need to make a local variable (like, "htext")
Then, in the changeState method
(case 1 = seconds 1 // or cycles x
= htext Display( 900 0 // text resource
dsCOORD 57 130
dsALIGN alCENTER
dsCOLOUR clCYAN
dsBACKGROUND clBLACK
dsWIDTH 200
dsSAVEPIXELS // saves the pixels the text overwrites
)
)(case 2 = seconds 1 // or cycles x
Display(
""
dsRESTOREPIXELS htext // re-displays those pixels
)
)
I think that should work. There is also an exaple of this in my march competition entry if you need more reference.
I'm not as sure about the cursor though...I'm sure there's a way, but I don't know it.
-
Doesn't seem to be working. Do I put the local variable for htext at the bottom where the instances are?
-
I tend to put the local variables here:
(include "sci.sh")
(include "game.sh")
(script 900)
(use "controls")
(use "cycle")
(use "feature")
(use "game")
(use "inv")
(use "main")
(use "obj")
(local
htext = 0
stateSwitch = 0
)
-
It looks like it's messing up the text when I run the game. All I see is an "8" and a comma or something.
I have this at the top:
(use "main")
(use "game")
(use "menubar")
(use "obj")
(use "cycle")
(use "user")
(use "controls")
(use "feature")
(local
title1 = 0
title2 = 0
)
And this in my cases:
(method (changeState newState)
= state newState
(switch(state)
(case 0
(theRomance:
init()
)
(theThrone:
init()
)
(= title1 "SCI Pre-Alpha Version 1.0")
Display(
@title1
dsFONT 4
dsCOORD 98 170
dsCOLOUR clMAROON
dsBACKGROUND clTRANSPARENT
dsSAVEPIXELS
)
(= title2 "By: Brandon Blume")
Display(
@title2
dsFONT 4
dsCOORD 115 180
dsCOLOUR clMAROON
dsBACKGROUND clTRANSPARENT
dsSAVEPIXELS
)
(theSpark1:
init()
setCycle(Fwd)
)
(theSpark2:
init()
setCycle(Fwd)
)
(theSpark3:
init()
setCycle(Fwd)
)
(theSpark4:
init()
setCycle(Fwd)
)
(theSpark5:
init()
setCycle(Fwd)
)
(theSpark6:
init()
setCycle(Fwd)
)
(theSpark7:
init()
setCycle(Fwd)
)
(theSpark8:
init()
setCycle(Fwd)
)
= seconds 10
)
(case 1
(theRomance:
dispose()
)
(theThrone:
dispose()
)
Display(
""
dsRESTOREPIXELS title1
dsRESTOREPIXELS title2
)
= seconds 2
)
(case 2
(buttonIntro:
init()
)
(buttonBegin:
init()
)
(buttonCred:
init()
)
(buttonCont:
init()
)
)
)
)
What I've done before trying this was display text with the exact same words except black over the orignial so it looks like it's gone but really isn't.
-
I'n not really familiar with using @title.
Instead of using
(= title1 "SCI Pre-Alpha Version 1.0")why not just put the "SCI Pre-Alpha Version 1.0" as a text resource?
Then to get it to display
= title1 Display( 800 0 // 800 is the title screen number and 0 is the first text resource
dsCOORD 57 130
dsALIGN alCENTER
dsCOLOUR clCYAN
dsBACKGROUND clBLACK
dsWIDTH 200
dsSAVEPIXELS // saves the pixels the text overwrites
)
Or, if you don't want to use text resources:
= title1 Display( "SCI Pre-Alpha Version 1.0"
dsCOORD 57 130
dsALIGN alCENTER
dsCOLOUR clCYAN
dsBACKGROUND clBLACK
dsWIDTH 200
dsSAVEPIXELS // saves the pixels the text overwrites
)
And for the disappearing act:
= title1 Display( "" dsRESTOREPIXELS htext)
I know I am not really working with what you are doing with your code, but I'n not really familiar with it, and I know the way I have it set up works.
-
Thank you! That seems to work. I was just getting the code messed up then.
-
Display(
""
dsRESTOREPIXELS title1
dsRESTOREPIXELS title2
)
I believe you can't have more than one RESTOREPIXELS in each call to Display().
-
Yeah, I've already changed that. :)
-
Nice. How then exactly do I implement those?
Also, I'm trying to hide the cursour as soon as the title screen appears until a certain case. I can't seem to find the code for that either.
Hey Brandon, there is one super dirty trick that I have come up with for hiding the cursor, when for some or other I feel the need ... splash screen or cutscene maybe. Anyway, just save one with nothing drawn on it. whenever you want to hide the cursor just set it to the invisible one.
you'll need to be damn sure that there isn't a chance though that they will need it before it becomes visible again, clicking on a button for instance would be really really hard to accomplish