Jump to content
Search Community

Getting kinetic.js function arguments

RobbyT15 test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I have a function which draws lines using kinetic.js and canvas. I'm trying to find a certain argument from the function and write that argument to the console when I click on each line. How would I go about doing this?  FYI, I'm trying to get the argument outside of the function.

Kinetic

function drawLine(name, points, fill, stroke, closed, strokeWidth){
    window[name] = new Kinetic.Line({
        points: points,
        fill: fill,
        stroke: stroke,
        closed: closed,
        strokeWidth: strokeWidth
    });
}
drawLine("NST_R01", [938.4, 258.167, 868, 258.167], "", red, "", 3);

The argument I want to get is the name argument.

 

Link to comment
Share on other sites

Sorry, I don't know of many KineticJS experts here.

 

I see you posted in the Stack Overflow kineticJS "forum". Probably get more action over there.

 

I'd suggest though that you make a CodePen or jsFiddle example for those guys so that it will be much easier for folks to experiment with and share a solution.

Link to comment
Share on other sites

This is the support forum for GSAP, not KineticJS. Your question makes no mention of GSAP, so I think it would be better aimed at the users of KineticJS. Their website suggests that they probably use stackoverflow as a support forum, and it can be a great place to get general javascript assistance http://stackoverflow.com/questions/tagged/kineticjs (seems like you're already on top of this)

 

We're the right guys to ask if you have questions about using GSAP with KineticJS, or GSAP itself. Unfortunately there's not enough time in a day for this forum to provide support for other frameworks or general javascript questions.

Edited by jamiejefferson
  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...