4 ms·
Can you explain a bit more what you mean about drawing white shapes? I've never had a problem: graphics.beginFill(0xFFFFFF); graphics.drawRect(10, 10, 100,
by gb 17y ago
Can you explain a bit more what you mean about drawing white shapes? I've never had a problem:
graphics.beginFill(0xFFFFFF);
graphics.drawRect(10, 10, 100, 100);
graphics.endFill();
- chipsy 17y agoI made a mistake in the original problem definition. Try: graphics.beginFill(0xFFFFFFFF); graphics.drawRect(10, 10, 100, 100); graphics.endFill(); The extra "FF" for alpha triggers it. But change any one of the entries to FE and it's fixed again. Edit(2): I just realized that this must stem from the behavior of Flash's unsigned 32-bit integers. Doubly odd since you'd think they'd mention this.
- iron_ball 17y agoA workaround is to specify only 0xFFFFFF; the last byte will default to FF (255), zero transparency.
- cjbos 17y agoIf you want to add alpha use the alpha parameter, don't specify it in the color value. The API makes a point of saying the color format is 0xRRGGBB. Use this instead: graphics.beginFill(0xFFFFFF, 0.5); //50% Alpha
- gb 17y agoAh, okay. I usually use the second argument of beginFill for specifying the alpha. Flash has quite a few quirks with Number vs int vs uint (it tends to switch types internally) so it could well be something to do with that. In fact, 0xFFFFFFFF is one of these cases: var n:uint = 0xFFFFFFFF; trace(n, getQualifiedClassName(n)); // result: 4294967295 Number