Community

SCI Programming => SCI Syntax Help => Topic started by: gumby on November 11, 2017, 10:16:51 AM

Title: Scaler error
Post by: gumby on November 11, 2017, 10:16:51 AM
I'm having a problem using the scaler.  When I call it with a view that has an instance explicitly declared in room (Egg) it works just fine, but when I call it on a view I create 'on-the-fly', the scaler throws an error of "<View setScale:> y value less than vanishingY".  My best guess is that I'm improperly creating the on-the-fly view, but I don't know how else to do it.

Code: [Select]
(method (init)
     (super init:)

     (Egg         view:24 loop:4 cel:0 x:100 y:100 init: setScale: Scaler 50 50)
     ((View new:) view:24 loop:4 cel:0 x:100 y:150 init: setScale: Scaler 50 50)
)
...

(instance Egg of Prop)

EDIT: Deferring the scaling doesn't seem to make a difference either.  The 'egg' instance works just fine, the dummy fails in the same way as the code above.
Code: [Select]
        (Egg view:24 loop:4 cel:0 x:100 y:100 init: )
        (Egg setScale: Scaler 50 50)
       
        (= dummy ((View new:) view:24 loop:4 cel:0 x:100 y:150 init:))
        (dummy setScale: Scaler 50 50)

EDIT2: I figured it out.  Shouldn't be using the 'View' class, should be using the 'Prop' class.  Once I changed the code to new-up a Prop it worked fine, which made perfect sense once I discovered the scaler property associated to Prop.  :-[
Title: Re: Scaler error
Post by: gumby on January 01, 2021, 05:47:42 PM
Old thread, but I finally fixed my game when running in ScummVM.

This is wrong:
Code: [Select]
   (dummy setScale: Scaler 50 50)

You must provide all 4 parameters to the Scaler call:
Code: [Select]
   (dummy setScale: Scaler 50 50 190 0)