Yazir Posted February 4, 2017 Share Posted February 4, 2017 Hello! I have a problem - I need to retrieve size of cuboids. How can i do that, I can only retrieve it's position. Also is there any simple way to make cuboids? Like making own definition to editor? Link to comment
Other Languages Moderators Lord Henry Posted February 7, 2017 Other Languages Moderators Share Posted February 7, 2017 On 04/02/2017 at 12:40, Yazir said: Hello! I have a problem - I need to retrieve size of cuboids. How can i do that, I can only retrieve it's position. Also is there any simple way to make cuboids? Like making own definition to editor? Are you using this to create the cube? local cubeCollider = createColCuboid ( posX, posY, posZ, sizeX, sizeY, sizeZ ) Link to comment
Dealman Posted February 7, 2017 Share Posted February 7, 2017 You should be able to get it via using getElementData. I'm not sure what the data is called but try "sizeX", "width" or "fWidth" I suppose. 1 Link to comment
Yazir Posted February 7, 2017 Author Share Posted February 7, 2017 @lordhenry Yes i use createColCuboid @Dealman I might try that. Is there a way to print out various element's data? Link to comment
Dealman Posted February 7, 2017 Share Posted February 7, 2017 (edited) There is the server-sided getAllElementData but whether or not it gets data added natively I don't know. If it returns a table simply loop through it and output the key and value. Edited February 7, 2017 by Dealman 1 Link to comment
Yazir Posted February 7, 2017 Author Share Posted February 7, 2017 I'll have a look on that. I have a problem with something else. I've drawn an rectangle with dxDrawRectangle, do you know how i can change it's size? Link to comment
3aGl3 Posted February 7, 2017 Share Posted February 7, 2017 The getAllElementData function returns only the data set with setElementData. Given that the wiki states width, depth and height as the attributes used in map files I'd say that are the names of the values you are looking for. Link to comment
Dealman Posted February 7, 2017 Share Posted February 7, 2017 23 minutes ago, Yazir said: I'll have a look on that. I have a problem with something else. I've drawn an rectangle with dxDrawRectangle, do you know how i can change it's size? DX drawings return no element, so you have to use variables and then change these when needed. Link to comment
Yazir Posted February 7, 2017 Author Share Posted February 7, 2017 (edited) expBar = dxDrawRectangle(screenW * 0.8562, screenH * 0.1731, screenW * 0.0906, screenH * 0.0139, tocolor(194, 129, 26, 255), true) So this won't work if it is as you say. I can set width to a variable then change the variable to change bar and it will update dynamically? Edited February 7, 2017 by Yazir Link to comment
Yazir Posted February 7, 2017 Author Share Posted February 7, 2017 Oh, I'm sorry I was so dumb. I see how it works now. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now