Skip to content
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

Setting canvas proprieties #51

Closed
yleflour opened this issue Dec 7, 2012 · 3 comments
Closed

Setting canvas proprieties #51

yleflour opened this issue Dec 7, 2012 · 3 comments

Comments

@yleflour
Copy link

yleflour commented Dec 7, 2012

I was not able to find a way of getting and setting the background proprieties (background = bottom layer).

@caleb531
Copy link
Owner

You can retrieve the layer object using the getLayer() method:

$("canvas").getLayer("someLayer");

After retrieving the layer object, you can get and set its properties.

Alternatively, you can set a layer's properties using the setLayer() method.

$("canvas").setLayer("someLayer", {
    opacity: 0.5
});

I hope that helps. Please respond if you need clarification.
-Caleb

@yleflour
Copy link
Author

Yann LEFLOUR
EFREI - Promo 2014

On Tue, Dec 11, 2012 at 1:06 AM, Caleb Evans notifications@github.comwrote:

You can retrieve the layer object using the getLayer() method:
$("canvas").getLayer("someLayer");

After retrieving the layer object, you can get and set its properties.

Alternatively, you can set a layer's properties using the setLayer()method.
$("canvas").setLayer("someLayer", {
opacity: 0.5
});

I hope that helps. Please respond if you need clarification.
-Caleb


Reply to this email directly or view it on GitHubhttps://github.com//issues/51#issuecomment-11225009.

I already understood how getting and setting worked. What I was wondering
is how you access canvas proprieties to set for example the canvas
background color.

@caleb531
Copy link
Owner

Oh, you mean CSS properties?

// Get property
$("canvas").css("backgroundColor");
// Set property
$("canvas").css({
  backgroundColor: "#fff"
});

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

No branches or pull requests

2 participants