-
Notifications
You must be signed in to change notification settings - Fork 176
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
Renderer rotation issue #56
Comments
Hi @oleksiikiselov, What happens if you hardcode the angle to 45 degrees: const Dolphin = props => {
const width = props.size[0];
const height = props.size[1];
const x = props.body.position.x - width / 2;
const y = props.body.position.y - height / 2;
return (
<View
style={[
{
position: 'absolute',
width,
height,
backgroundColor: props.color,
transform: [{ rotate: `45deg` }],
},
{ left: x, top: y },
]}
>
<Text color="white">{props.title}</Text>
</View>
);
}; Does the Dolphin appear rotated? It would be good to figure out whether the problem lies with MatterJS or there is something funny happening with the React Native |
Hi @oleksiikiselov, I think the issue might then be that You can try and integrate Hope that helps! |
Hi @bberak, Excuse me please, had to delete my previous message. Thank you for the advice, sounds reasonable. Will try to add that and get back to you. Thank you very much. |
Hello everyone 👋
I am trying to rotate one of my elements on the screen and I do this with
Matter.js
andreact-native-game-engine
all together.I have the following logic:
Count angle for rotation manually => set this angle to the
Matter.js
body => achieve this newly set angle inside my render via props => trying to rotate myView
withtransform
.So everything works well until the last step when I am trying to rotate my
View
. It is not rotating at all, butMatter.js
body has newly set angle. I think the issue can be inside rendering logic, but still not sure. Tried a lot of solutions already. Any help is appreciated.This is my code:
This is my renderer component
This is how I set angle with
Matter.js
:The text was updated successfully, but these errors were encountered: