Store a color as a cast member...

Ask a Question related to Macromedia Director Lingo, Design and Development.

  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. Similar Questions and Discussions

    1. 3D cast member access
      hi all, i want to exchange 3d model data with a director app and a 3rd party application at runtime. because the data must go both ways and...
    2. How to let objects in a cast member be a child of agroup(or a model) in another cast member?
      I want to add a model to the scene. I try this code: member('world').newgroup('gr2') member('world').group('gr2').addchild(member('r2').model(1)) ...
    3. Cast member name limit bug
      I can assign a long name to a member's name property, but if I try to retrieve it by that name, it fails. For example, the following statement is...
    4. where to store external cast files
      Could someone please tell me where the best place is to store external casts? Are the ".cst" files included in the projector? And can the cast...
    5. copy cast member
      Hi, I need making a copy of member 1 from cast 2 to member 3 from cast 1... how to make? please, in lingo...... no (ctrl +c and ctrl+v)
  3. #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" <no@spam.com>
    wrote:
    >o
    Richie Bisset Guest

  4. #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

  5. #4

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

    In article <bkqsfs$pco$1@forums.macromedia.com>, "Darrel Hoffman"
    <no@spam.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

Posting Permissions

  • You may not post new threads
  • You may 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