Professional Web Applications Themes

adding dynamic score - Macromedia Director 3D

i am using overlay to add interface to the 3d game i am working on.But the problem is that overlay option uses static textures.How can i make this dynamic so that i can add dynamic score to my game....

  1. #1

    Default adding dynamic score

    i am using overlay to add interface to the 3d game i am working on.But the problem is that overlay option uses static textures.How can i make this dynamic so that i can add dynamic score to my game.

    mickybhai Guest

  2. #2

    Default Re: adding dynamic score

    There are a few ways to do this.

    Set up a library with small bitmap images 0-9 (or tiffs with alpha if you
    want transparent backdrop to your score and make sure the
    textureRenderFormat is set to #rgba8888 or #rgba4444).

    Make sure they follow the power2 size rule eg 16x32 8x16 16x16 32x64 etc. .
    .. or they will be blurred.

    Create your 5 (or whatever) digit score overlays and position them
    correctly.

    Create 10 new textures from your digit bitmaps.

    Whenever the score changes, change the 5 overlays using. . .

    sprite(whichSprite).camera.overlay[overlayIndex].source

    to match the desired texture and display the correct numbers.

    You can store your texture references in a list to enable logical access.

    You can also use one single overlay, and create some dynamic imaging lingo
    to copyPixels() the numbers onto a single image and use that as the
    texture.member each frame, but that's much more complex to setup.

    Last of all you could create a single score overlay, and set it's
    texture.member to a text member containing the score each frame. Make sure
    you create the text member's box so it is sized to the power2 rule. Test
    this by placing it on the stage and checking it's sprite dimensions in the
    property Inspector.

    Hope that starts you off at least.

    Rix


    Richard Guest

Similar Threads

  1. Question Adding Instance name to Dynamic Text Box
    By Frustrated in forum Brainstorming Area
    Replies: 0
    Last Post: February 26th, 06:33 PM
  2. Adding dynamic controls to pageview - set location
    By elad in forum ASP.NET Building Controls
    Replies: 0
    Last Post: November 6th, 02:22 PM
  3. Adding to a score
    By Opyuse webforumsuser@macromedia.com in forum Macromedia Director Lingo
    Replies: 2
    Last Post: August 13th, 10:29 PM
  4. Help! Adding to Score field
    By Opyuse webforumsuser@macromedia.com in forum Macromedia Director Lingo
    Replies: 1
    Last Post: August 12th, 08:11 PM
  5. adding dynamic content to a button
    By Steven in forum ASP.NET General
    Replies: 1
    Last Post: August 11th, 04:36 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