Game Maker's Garage Forum

Game Creation => GameMaker => Topic started by: Gnome on May 04, 2008, 09:13:22 AM

Title: PICT command
Post by: Gnome on May 04, 2008, 09:13:22 AM
what does it do?  ???
Title: Re: PICT command
Post by: Al Staffieri on May 04, 2008, 10:18:30 AM
It displays another card's picture on the current card.

EXAMPLE:
You are on card 10. In a script in card 10 you write:
  PICT 20
When you run that script it will show card 20's picture in the picture area.
Title: Re: PICT command
Post by: Gnome on May 04, 2008, 10:51:22 AM
Oh, That'll save me a bunch of time!
Thanks Al!
Title: Re: PICT command
Post by: Charlo on May 04, 2008, 08:57:35 PM
I once tried to use PICT/PICT CLEAR in a timer and it didn't work...I was trying to get a "flashing" effect.

the code was something like

ON TIMER 10 PICT CLEAR
ON TIMER 10 PICT
ON TIMER 10 PICT CLEAR
ON TIMER 10 PICT

Am I totally messing this up?  :D
Title: Re: PICT command
Post by: Tireas Dragon on May 04, 2008, 09:52:17 PM
Yes. In order to do a flashing effect using the PICT command you need a blank card. Also, since you cant put TIMERs within TIMERs you have to use a loop script. This is how I would cause the flashing effect. just so you know this flashing effect would be permanent until you go to a different card.
(lets use 25 as our blank card and 20 as our current card)
"Loop Script ON"

IF x = 0 THEN
  x = 2
  ON TIMER 10
    x = 1
    PICT 20
  END TIMER
END IF
IF x = 1 THEN
  x = 2
  ON TIMER 10
    x = 0
    PICT 25
  END TIMER
END IF

If you need to put other stuff in the card script you can
IF y = 0 THEN
  y = 1
  'all my cool commands and stuff'
END IF
Title: Re: PICT command
Post by: Al Staffieri on May 05, 2008, 07:27:24 AM
Card 25 doesn't have to be blank. You can use this as a way to keep flashing between 2 pictures to create sort of an animated card picture. Here's really simple code to do it.

ON TIMER 10
  TOGGLE X
  IF X = 0 THEN PICT 25
  IF X <> 0 THEN PICT 20
END TIMER