On Fri, 22 Sep 2006 12:06:20 +0200, revelonshift <[EMAIL PROTECTED]> wrote:
> OK, thx, you're right. But since getting matrix is done only once at > the initiation phase and during gameplay is only updated, I will > probably stay at my previous solution... > Anyway .. thx for your point... but, during game I'm often affecting > fill attribute and sometimes using rgb color schema. Is there some > object, comthing like NewRgbColorSVG/NewhexColorSVG to use it in > similar way like: object.style.fill = NewRgbColorSBG(0,10,20)? or any > other way? Parsing of rgb or even hexa could take time and if there is > some faster way and I've fill in heavy yous, I'll give it a chance... Experiment with the following: var obj = element.getPresentationAttribute("fill"); obj.setRGBColor("red"); // Spec is fuzzy on what's acceptable input, but try "rgb(r,g,b)" or "#RGB" or named colors There's no way to create an SVGPaint or an SVGColor from the SVG DOM (there is no equivalent to NewRgbColorSBG(0,10,20)). But you can assign element.style.fill any valid SVGPaint string, like "url(#foo)", "red" or "rgb(1,2,3)". Either of these two might be more expensive than changing the corresponding presentation attribute with setAttributeNS. Contrary to what people seem to suggest here, clipping might actually help your game perform better. Try using clipping for small areas that change often, for example the time counter. Sometimes it's better with larger clipping areas, sometimes it's worse, it depends on the svg. Use pointer-events="none" on everything that isn't interested in mouse-events, and try to group things so that you don't need to set it on all elements. Hope this helps /Erik -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/