Skip to content

Support built-in variables #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
21 tasks done
gaocegege opened this issue Jun 6, 2017 · 7 comments
Closed
21 tasks done

Support built-in variables #98

gaocegege opened this issue Jun 6, 2017 · 7 comments

Comments

@gaocegege
Copy link
Member

gaocegege commented Jun 6, 2017

There are some built-in variables such as height, width and frameCount, some works and others don't work, now.

Screen

Time

Geometry

Interaction

@jeremydouglass
Copy link
Member

You mentioned that some variables work -- can you give an example of one that works? In my last round of tests none of them were working, but I might not be calling them correctly.

I would say this may be higher than p3 because the majority of all demo Processing sketches use the width and height variables.

@gaocegege
Copy link
Member Author

For example:

yPos <- 0

draw <- function() {
    background(as.integer(204))
    yPos <- yPos - 1
    if (yPos < 0) {
        yPos <- height
    }
    line(0, yPos, width, yPos)
}

I set it to p3 because width and height works well. Do you meet any error when using these two variables?

@jeremydouglass
Copy link
Member

jeremydouglass commented Jun 6, 2017

Got it. I see that you've now added width and height, so I'm catching up.

I've updated the checklist above for checking off specific things as they are resolved.

If it makes sense then break parts of the list off into other issues -- for example, if the interaction constants won't be implemented.

Note also the related:

@jeremydouglass
Copy link
Member

jeremydouglass commented Jul 21, 2017

For new contributors, it looks like exposing the keyPressed and mousePressed booleans are only things left in this issue.

Currently frameCount is exposed in RLAngPApplet.java handleDraw():

https://github.com/gaocegege/Processing.R/blob/master/src/rprocessing/RLangPApplet.java#L332

while focused is exposed in wrapProcessingVariables():

https://github.com/gaocegege/Processing.R/blob/master/src/rprocessing/RLangPApplet.java#L387

@gaocegege
Copy link
Member Author

Closed since it has been solved.

@jeremydouglass
Copy link
Member

OK! -- Is the "keyPressed function vs keyPressed variable" aspect still open via #170?

@gaocegege
Copy link
Member Author

Yeah, I haven't solved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants