Professional Web Applications Themes

Store a color as a cast member... - Macromedia Director Lingo

I'm trying to decide what's the best way to do this. I've created a game, and I'm now making it "skinnable", like, say, Winamp. (It's nothing like Winamp, other than that. It's a game, damnit.) Anyways, I'm basically storing the "skins" as their own seperate external casts. I would like the entire skin to exist as a single file, for ease of use. Each "skin" contains all the custom graphics, sound effects, and text elements for the game. What I also want to do is to have various colors, rgb values, stored as individual cast members. I'd like to able ...

  1. #1

    Default Store a color as a cast member...

    I'm trying to decide what's the best way to do this. I've created a game, and I'm now making it
    "skinnable", like, say, Winamp. (It's nothing like Winamp, other than that. It's a game,
    damnit.) Anyways, I'm basically storing the "skins" as their own seperate external casts. I
    would like the entire skin to exist as a single file, for ease of use. Each "skin" contains all
    the custom graphics, sound effects, and text elements for the game. What I also want to do is
    to have various colors, rgb values, stored as individual cast members. I'd like to able to just
    say: 'redSwatch.color = member("redSwatch", gSkin).color'. However, I can't seem to find any
    way to store just a color as a cast member. I tried making a colored rectangle, but apparently
    that doesn't store any color info except in the icon it shows in the cast. I suppose I could
    have a 1-pixel bitmap and use imaging lingo to read the color of the pixel, but that's kind of
    an annoying way to do it. (Especially since I want to also create a skin-creator application,
    to make it easy for users to create their own skins.) I could use a text/field object with the
    text or its background set to the colors in question, again, seems a bit of a round-about way of
    doing it. I thought about using a Palette object, but first of all, it creates 256 colors, not
    just 1 at a time, (I need 3 total), and secondly, I'm not even sure there's any way of easily
    accessing an individual color from a palette like that. (I don't want to have to use the
    Palette channel in the score, I think that's pretty much an out-dated feature from the days of
    8-bit color anyways.) Finally, I could store the color simply as text in a text/field member,
    one line which simply says "rgb(255,255,255)" or something. Or maybe I could store 3 seperate
    numbers for R, G, and B values, using an item delimiter between them. All of these techniques
    really seem like hack-job ways of doing this, however. Is there any really good way of just
    storing a single color value, all by itself in a cast member?


    Darrel Hoffman Guest

  2. #2

    Default Re: Store a color as a cast member...

    storing the colour as a string sounds like the best option to me. ten
    it would be fairly easy to use lingo to apply it to sprites. remember
    you can use hex colors instead of rgb too.

    hth,

    richie

    On Tue, 23 Sep 2003 21:42:50 -0400, "Darrel Hoffman" <nospam.com>
    wrote:
    >o
    Richie Bisset Guest

  3. #3

    Default Re:Store a color as a cast member...

    I've heard theres a properties xtra. Thats the ideal solution for games. I don't know anything else about it though.


    HAIRYBOBBY - why didn't I choose a really cool name like the vulcanpimp

    [url]http://www.geocities.com/hairybobby2000[/url]

    new vector shape behaviors here

    [url]http://www.geocities.com/hairybobby2000/vertexhome.html[/url]
    hairybobby webforumsuser@macromedia.com Guest

  4. #4

    Default Re: Store a color as a cast member...

    In article <bkqsfs$pco$1forums.macromedia.com>, "Darrel Hoffman"
    <nospam.com> wrote:
    > 8-bit color anyways.) Finally, I could store the color simply as text
    in a text/field member,
    > one line which simply says "rgb(255,255,255)" or something. Or maybe I
    could store 3 seperate

    This is nowhere near as economical as Robert's pixel idea, but when I had
    to do it I stored it as text with a forecolor and used the forecolor of
    word 1 of field whatever to retrieve it. That was before there was a color
    object but it would still work with that, with the added advantage that
    you could see the colors.

    Gretchen Macdowall
    [url]http://www.updatestage.com/[/url]
    Gretchen Macdowall Guest

Similar Threads

  1. 3D cast member access
    By jonnno in forum Macromedia Director 3D
    Replies: 0
    Last Post: August 28th, 07:00 PM
  2. Replies: 1
    Last Post: November 7th, 02:18 AM
  3. 3d cast member with transparent bg
    By jsegura in forum Macromedia Director 3D
    Replies: 1
    Last Post: July 4th, 03:25 PM
  4. Cast member name limit bug
    By Gary in forum Macromedia Director Lingo
    Replies: 6
    Last Post: November 11th, 05:12 PM
  5. copy cast member
    By Jota Mix in forum Macromedia Director Lingo
    Replies: 3
    Last Post: September 30th, 12:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139