-
-
Notifications
You must be signed in to change notification settings - Fork 254
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
Example using library functions in react #58
Comments
You can get reference of your simpleText node in
https://github.com/lavrton/react-konva#getting-reference-to-konva-objects |
Hello; I want to perform move a Rect element on press key in keyboard, I have
But my Rect element is not moving on keyDown :( , it still on x=0, y=0. |
@bay007 changing attributes of a node directly is not recommended in |
would it be possible to add an example where you illustrate how to use for instance .setOffset on text in a react context?
`
var simpleText = new Konva.Text({
x: stage.getWidth() / 2,
y: 15,
text: 'Simple Text',
fontSize: 30,
fontFamily: 'Calibri',
fill: 'green'
});
// to align text in the middle of the screen, we can set the
// shape offset to the center of the text shape after instantiating it
simpleText.setOffset({
x: simpleText.getWidth() / 2
});
`
The text was updated successfully, but these errors were encountered: