Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Pic.SetTransparentColor is being a piece of crap!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Danjen




PostPosted: Sat May 12, 2007 3:23 pm   Post subject: Pic.SetTransparentColor is being a piece of crap!

I'm having trouble using the Pic.SetTransparentColor command.
What I'm trying to do is to have a character graphic which is colored in various shades pf grey then use Pic.SetTransparentColor to single out a particular shade and paste the picture over a color, effectively allowing the sprite to be colored any color. The problem is that whatever I set Pic.SetTransparentColor, it to won't change anything! It only seems to work with predefined colors like brightred Sad

Turing:

var spr : int := Pic.FileNew ("Res/Sprites/Char/Male/front2.bmp") %%Japanime style character graphic
type colRGB :
    record
        R, G, B : real
    end record
var col : int
var Color : colRGB

var CharCol :
    record
        %%No underscore variable = Composite color filter
        %%Underscore variable = RGB color filter
        Body1t, Body2t, Hair1t, Hair2t, Eye1t, Eye2t, Cloth1t, Cloth2t :
            int
        Body1c, Body2c, Hair1c, Hair2c, Eye1c, Eye2c, Cloth1c, Cloth2c :
            int
        Body1t_, Body2t_, Hair1t_, Hair2t_, Eye1t_, Eye2t_, Cloth1t_, Cloth2t_ :
            colRGB
        Body1c_, Body2c_, Hair1c_, Hair2c_, Eye1c_, Eye2c_, Cloth1c_, Cloth2c_ :
            colRGB
    end record

CharCol.Body1t_.R := 48 / 255
CharCol.Body1t_.G := 48 / 255
CharCol.Body1t_.B := 48 / 255
CharCol.Body2t_.R := 64 / 255
CharCol.Body2t_.G := 64 / 255
CharCol.Body2t_.B := 64 / 255
CharCol.Hair1t_.R := 80 / 255
CharCol.Hair1t_.G := 80 / 255
CharCol.Hair1t_.B := 80 / 255
CharCol.Hair2t_.R := 96 / 255
CharCol.Hair2t_.G := 96 / 255
CharCol.Hair2t_.B := 96 / 255
CharCol.Eye1t_.R := 112 / 255
CharCol.Eye1t_.G := 112 / 255
CharCol.Eye1t_.B := 112 / 255
CharCol.Eye2t_.R := 128 / 255
CharCol.Eye2t_.G := 128 / 255
CharCol.Eye2t_.B := 128 / 255
CharCol.Cloth1t_.R := 144 / 255
CharCol.Cloth1t_.G := 144 / 255
CharCol.Cloth1t_.B := 144 / 255
CharCol.Cloth2t_.R := 160 / 255
CharCol.Cloth2t_.G := 160 / 255
CharCol.Cloth2t_.B := 160 / 255

CharCol.Body1c_.R := 255 / 255
CharCol.Body1c_.G := 128 / 255
CharCol.Body1c_.B := 64 / 255
CharCol.Body2c_.R := 255 / 255
CharCol.Body2c_.G := 112 / 255
CharCol.Body2c_.B := 43 / 255
CharCol.Hair1c_.R := 128 / 255
CharCol.Hair1c_.G := 128 / 255
CharCol.Hair1c_.B := 0 / 255
CharCol.Hair2c_.R := 106 / 255
CharCol.Hair2c_.G := 53 / 255
CharCol.Hair2c_.B := 0 / 255
CharCol.Eye1c_.R := 0 / 255
CharCol.Eye1c_.G := 0 / 255
CharCol.Eye1c_.B := 255 / 255
CharCol.Eye2c_.R := 0 / 255
CharCol.Eye2c_.G := 0 / 255
CharCol.Eye2c_.B := 128 / 255
CharCol.Cloth1c_.R := 0 / 255
CharCol.Cloth1c_.G := 255 / 255
CharCol.Cloth1c_.B := 0 / 255
CharCol.Cloth2c_.R := 0 / 255
CharCol.Cloth2c_.G := 128 / 255
CharCol.Cloth2c_.B := 0 / 255

CharCol.Body1c := RGB.AddColor (CharCol.Body1c_.R, CharCol.Body1c_.G, CharCol.Body1c_.B)
CharCol.Body2c := RGB.AddColor (CharCol.Body2c_.R, CharCol.Body2c_.G, CharCol.Body2c_.B)
CharCol.Hair1c := RGB.AddColor (CharCol.Hair1c_.R, CharCol.Hair1c_.G, CharCol.Hair1c_.B)
CharCol.Hair2c := RGB.AddColor (CharCol.Hair2c_.R, CharCol.Hair2c_.G, CharCol.Hair2c_.B)
CharCol.Eye1c := RGB.AddColor (CharCol.Eye1c_.R, CharCol.Eye1c_.G, CharCol.Eye1c_.B)
CharCol.Eye2c := RGB.AddColor (CharCol.Eye2c_.R, CharCol.Eye2c_.G, CharCol.Eye2c_.B)
CharCol.Cloth1c := RGB.AddColor (CharCol.Cloth1c_.R, CharCol.Cloth1c_.G, CharCol.Cloth1c_.B)
CharCol.Cloth2c := RGB.AddColor (CharCol.Cloth2c_.R, CharCol.Cloth2c_.G, CharCol.Cloth2c_.B)

CharCol.Body1t := RGB.AddColor (CharCol.Body1t_.R, CharCol.Body1t_.G, CharCol.Body1t_.B)
CharCol.Body2t := RGB.AddColor (CharCol.Body2t_.R, CharCol.Body2t_.G, CharCol.Body2t_.B)
CharCol.Hair1t := RGB.AddColor (CharCol.Hair1t_.R, CharCol.Hair1t_.G, CharCol.Hair1t_.B)
CharCol.Hair2t := RGB.AddColor (CharCol.Hair2t_.R, CharCol.Hair2t_.G, CharCol.Hair2t_.B)
CharCol.Eye1t := RGB.AddColor (CharCol.Eye1t_.R, CharCol.Eye1t_.G, CharCol.Eye1t_.B)
CharCol.Eye2t := RGB.AddColor (CharCol.Eye2t_.R, CharCol.Eye2t_.G, CharCol.Eye2t_.B)
CharCol.Cloth1t := RGB.AddColor (CharCol.Cloth1t_.R, CharCol.Cloth1t_.G, CharCol.Cloth1t_.B)
CharCol.Cloth2t := RGB.AddColor (CharCol.Cloth2t_.R, CharCol.Cloth2t_.G, CharCol.Cloth2t_.B)

View.Set ("graphics:640;400,offscreenonly")
Draw.FillBox (0, 0, Pic.Width (spr) - 1, Pic.Height (spr) - 1, CharCol.Body1c)
Pic.SetTransparentColor (spr, 265)
Pic.Draw (spr, 0, 0, picMerge)
for i : 255 .. RGB.maxcolor
    Draw.FillBox ((i - 255) * 10, 200, (i - 254) * 10, 210, i)
end for
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: