animation - ActionScript - Screen Wrapping A Gradient Line? -


i have straight, gradient line extends 1 end of screen other.

what best (or only) approach screen wrapping line graphic, appears moving?

my current "solution" draw horizontal line @ double width of screen , duplicate gradient pattern each half of line. line center-registered , it's moved toward right. once half of line traverses stage, line reset it's starting point.

is there better way?

well, alternative can think of using drawing api draw gradient stroke, calculating offset in each frame. more costly applying positional transform on display object. tiny bit of arithmetic alone should enough make slower.

your proposed solution may not seem elegant, or efficient running in vm highly optimized drawing , transforming occluded vectors , bitmaps (and undependable on every other optimization) think best bet trust vm @ point. :)


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -