Search found 19 matches

by coiner
Sat Sep 24, 2011 4:57 am
Forum: SVG / XML Code
Topic: Searching for parents
Replies: 1
Views: 1796

Re: Searching for parents

I'm not sure if this is what you want but here goes... You could give all of the <use> tags a class of 'Ball' or similar and then use document.getElementsByClassName('Ball') Example: <script type="text/javascript"> <![CDATA[ function getBalls() { return document.getElementsByClassName('aBa...
by coiner
Wed Sep 14, 2011 9:15 am
Forum: SVG / XML Code
Topic: Negative values in absolute positions!!
Replies: 5
Views: 5059

Re: Negative values in absolute positions!!

I just borrowed an iPad and ran the acid test on the iOS Safari and it scored a 99 so SVG support is definitely available on the iPhone/Pad, I've yet to test an android but I would bet money it has full supp0rt.
by coiner
Tue Sep 13, 2011 11:51 pm
Forum: SVG / XML Code
Topic: Negative values in absolute positions!!
Replies: 5
Views: 5059

Re: Negative values in absolute positions!!

I don't have an iPhone to test but I believe the only SVG it doesn't support are SMIL animations and it doesn't sound like you will need that for what you are doing. Most likely full support will happen in the coming months anyway, so you will be ahead of the game. I have created a very quick exampl...
by coiner
Tue Sep 13, 2011 12:04 pm
Forum: SVG / XML Code
Topic: Negative values in absolute positions!!
Replies: 5
Views: 5059

Re: Negative values in absolute positions!!

Not to crap all over your idea, but why would you convert a newer tech into old, basically deprecated one? This could easily be achieved using pure SVG.
by coiner
Tue Sep 13, 2011 3:26 am
Forum: SVG / XML Code
Topic: animateMotion and getting position along path
Replies: 8
Views: 4187

Re: animateMotion and getting position along path

Don't give up so soon because I have solved the issue! I have modified the svgdoc from before. The method I found to work is "getCTM()" This method returns the "Current Transformation Matrix" of the element that it is called upon. All transforms on an element are held within a 2x...
by coiner
Sun Sep 11, 2011 7:41 am
Forum: SVG / XML Code
Topic: animateMotion and getting position along path
Replies: 8
Views: 4187

Re: animateMotion and getting position along path

Hm yes, I see it does not factor in any transforms on the item which is quite unfortunate.

I will tinker a bit more.
by coiner
Sat Sep 10, 2011 6:50 am
Forum: SVG / XML Code
Topic: Collision Detection on SMIL Animation Path
Replies: 4
Views: 4012

Re: Collision Detection on SMIL Animation Path

I have (somewhat) solved this issue using the getBBox() method. Although I have not done collision detection, I have successfully found the coordinates of an animated element using getBBox() and getCTM(). Working example follows:

http://static.dorshnik.com/test/point-on-path.svg
by coiner
Sat Sep 10, 2011 6:24 am
Forum: SVG / XML Code
Topic: animateMotion and getting position along path
Replies: 8
Views: 4187

Re: animateMotion and getting position along path

Hello there! I have successfully gotten the coordinates of an element along an animation path. In this basic example I have used an interval to monitor an animated rectangle. As I said, the answer was in the method getBBox(). If you are going to monitor anything other than a rectangle, please note t...
by coiner
Fri Sep 09, 2011 11:42 am
Forum: SVG / XML Code
Topic: animateMotion and getting position along path
Replies: 8
Views: 4187

Re: animateMotion and getting position along path

Hi, I actually asked this question a few months ago on this forum but never found a definite answer. I DO think it is possible though, and I think the answer lies in the method "getBBox()" I am feeling a bit curious about this again so I think I will create a test to find out if this will ...
by coiner
Wed Sep 07, 2011 3:31 am
Forum: SVG / XML Code
Topic: Access parent DOM through script in embedded SVG
Replies: 2
Views: 5263

Re: Access parent DOM through script in embedded SVG

Well it turns out that the solution to this was so simple that I'm ashamed I posted this :oops: I'm sure that the specificity of this post will help someone though. So to access the parent html DOM from a script within an embedded SVG document, all you have to do is get the window's parent like so: ...
by coiner
Wed Sep 07, 2011 1:08 am
Forum: SVG / XML Code
Topic: Access parent DOM through script in embedded SVG
Replies: 2
Views: 5263

Access parent DOM through script in embedded SVG

I am working on an SVG web application that I am embedding into an HTML5 page. The SVG doc has its own script that performs operations on the entire page. For the sake of example, I will show what I would like to accomplish using the HTML5 <audio> tag. Interacting with this element is cake if I embe...
by coiner
Thu Jul 07, 2011 8:48 am
Forum: SVG / XML Code
Topic: spritemaps for icons
Replies: 8
Views: 3727

Re: spritemaps for icons

After testing myself, this is definitely the method I will use for mapping these sprites.

Here is a working example:

http://static.dorshnik.com/wow/test.svg
by coiner
Thu Jul 07, 2011 7:31 am
Forum: SVG / XML Code
Topic: spritemaps for icons
Replies: 8
Views: 3727

Re: spritemaps for icons

Hmmm interesting. So you're saying that if I position the element over the desired icon in the spritemap pattern and then translate it elsewhere, it will "move" the icon with it? Genius!

I'll give it a try and post the results.
by coiner
Wed Jul 06, 2011 10:43 am
Forum: SVG / XML Code
Topic: spritemaps for icons
Replies: 8
Views: 3727

Re: spritemaps for icons

Damn! I thought I had this figured out a minute ago but I've hit a wall again. I tried making a pattern out of the spritemap and then using it as the fill of a rect element. It shows up fine but the pattern coordinates apply to the entire svg space and thus you cannot position the spritemap for more...
by coiner
Wed Jul 06, 2011 9:55 am
Forum: SVG / XML Code
Topic: spritemaps for icons
Replies: 8
Views: 3727

Re: spritemaps for icons

I don't understand the layer idea. Wouldn't I still have to have all the images as separate files for that?
by coiner
Tue Jul 05, 2011 4:29 pm
Forum: SVG / XML Code
Topic: spritemaps for icons
Replies: 8
Views: 3727

spritemaps for icons

I am working to create an SVG web app and I have around 50 external icons that the app uses. It would be great if I could put all of these icons into one spritemap like with css sprites. I can't think of a way to do this using SVG off the top of my head so if anyone has suggestions please post. The ...
by coiner
Fri Apr 01, 2011 6:29 am
Forum: SVG / XML Code
Topic: SVG in HTML, with CSS and JS
Replies: 3
Views: 5439

Re: SVG in HTML, with CSS and JS

The only way I've ever gotten SVG to work within an HTML page is to define it as XML instead of HTML. The file must have .xml extension (not ..html
by coiner
Fri Apr 01, 2011 6:21 am
Forum: SVG / XML Code
Topic: Collision Detection on SMIL Animation Path
Replies: 4
Views: 4012

Re: Collision Detection on SMIL Animation Path

I don't really understand what you mean by this, are you talking about distance along animation paths or a path element? Perhaps an example would make it clear. As for my own progress on this issue, I've been trying to use the "getBBox()" method of the animated element to obtain its curren...
by coiner
Mon Mar 14, 2011 5:29 pm
Forum: SVG / XML Code
Topic: Collision Detection on SMIL Animation Path
Replies: 4
Views: 4012

Collision Detection on SMIL Animation Path

I have a thread in JavaScript watching two animated shapes. I would like to detect when they collide but I can't get the current position of the shapes as the animateTransform being processed does not update the shapes' coordinates. How should I go about collision detection with SMIL animates?

Go to advanced search