Community
SCI Programming => SCI Syntax Help => Topic started by: Cloudee1 on March 18, 2010, 04:46:54 PM
-
Hey guys, I can't seem to find the write syntax for adding one picture on top of another picture. basicly what I want to do, is if I'm in a room and you do something, it draws the new room directly on top of the current room. Why I want to do it will make sense in a couple of weeks or so...
something like picOverlay or something similar, I'm not sure I've never actually done it before. If anybody knows or has fiddled with it themselves, some info would be a great help.
-
I used it in the Knight's Quest demo. Here is the code from my game
DrawPic(13 dpOPEN_LEFT dpCLEAR 0)
-
http://sciprogramming.com/community/index.php?topic=227.0 (http://sciprogramming.com/community/index.php?topic=227.0)
I made a thread about this ages ago here before the forums went down. Might find some additional useful information there. The only reason I remember it is because I was going through old threads recently and reminiscing.
Seems like the overlay method is the better choice apparently.
-
Hmm, I knew I heard about it somewhere. The only problem with the thread you posted is that you guys never actually mentionned any syntax to go along with it.
... I unfortunately don't seem to have the help files anymore, I'm not sure why though. Wait check that, they come packaged up with the scistudio that is available for download here ::)
It turns out though, that what I want to do isn't quite as straightforward as I thought it was going to be. I'll have to look into it a little more. What I am trying to do is leave say room1 and enter room2 without clearing the room1 screen instead just overlaying room2's picture.
What I tried at first was to simply use the gPreviousroom variable as the picture resource in room2's init stuff, but the compiler doesn't recognise that as an integer so unfortunately that didn't work. anybody have any ideas.
-
Alright, so I figured out how to do what it was that I was wanting to do.
In the new room, I simply left the properties empty for the public instance, and added a drawpic command directly following the init method declaration.
(instance public rm500 of Rm
(properties)
(method (init)
DrawPic(500 dpOPEN_INSTANTLY dpNO_CLEAR)
(super:init())
It works just like I wanted it to.
-
Hi Cloudee1 (and thanks for the heads-up, btw!)
Just using the kernel call will fail if you save the game in that location and later restore it...
the kernel call does not record the fact that you've called it anywhere, while the method calls do.
Regards,
Lars
-
Nice to see you, lskovlun!
-
That's good to know, but as for my purposes, It is not possible to save when this action is occuring so things work out for me there.
By the way check out the point and click tutorial, that is where I used this. I would love to hear any comments you have about it.