Author Topic: Overlaying one pic to another pic  (Read 4559 times)

0 Members and 1 Guest are viewing this topic.

Offline Cloudee1

Overlaying one pic to another pic
« 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.


Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline Doan Sephim

Re: Overlaying one pic to another pic
« Reply #1 on: March 18, 2010, 06:34:54 PM »
I used it in the Knight's Quest demo. Here is the code from my game

Code: [Select]
DrawPic(13 dpOPEN_LEFT dpCLEAR 0)

Offline MusicallyInspired

Re: Overlaying one pic to another pic
« Reply #2 on: March 19, 2010, 12:23:38 PM »
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.
« Last Edit: March 19, 2010, 12:25:39 PM by MusicallyInspired »
Brass Lantern Prop Competition

Offline Cloudee1

Re: Overlaying one pic to another pic
« Reply #3 on: March 19, 2010, 03:59:04 PM »
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.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline Cloudee1

Re: Overlaying one pic to another pic
« Reply #4 on: March 22, 2010, 04:39:50 PM »
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.

Code: [Select]
(instance public rm500 of Rm
(properties)

  (method (init)
  DrawPic(500 dpOPEN_INSTANTLY dpNO_CLEAR)
  (super:init())

It works just like I wanted it to.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline lskovlun

Re: Overlaying one pic to another pic
« Reply #5 on: April 03, 2010, 05:07:28 PM »
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

Offline MusicallyInspired

Re: Overlaying one pic to another pic
« Reply #6 on: April 03, 2010, 06:27:44 PM »
Nice to see you, lskovlun!
Brass Lantern Prop Competition

Offline Cloudee1

Re: Overlaying one pic to another pic
« Reply #7 on: April 03, 2010, 09:04:54 PM »
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.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.043 seconds with 23 queries.