Home › Forums › Development discussions › Questions
- This topic has 94 replies, 3 voices, and was last updated 10 years ago by Akira_San.
-
AuthorPosts
-
November 10, 2014 at 23:25 #536Akira_SanParticipant
I experimented and found, that the character box must be a convex hull in order to fall on the ground. It dont touch the ground if its set to a box, is that natural? And thx, i forgot about the speed option.
November 12, 2014 at 12:37 #537SponkKeymasterThe bounding-box != your mesh!
The box is bigger than your mesh in certain areas to include all max and min points.
The convex hull calculates a more sophisticated shape around your object to fit it better.
You might want to use another box as a parent and scale the box to best fit your mesh manually since the convex hull is generally slower.November 13, 2014 at 22:26 #538Akira_SanParticipantOk, i change the ground to triangle mesh and that works. Now the character walks on the ground. Too bad i lost some of my bookmark links after the pc upgrade…
November 15, 2014 at 11:30 #540SponkKeymasterThat sucks big time. You should do some backups in future before upgrading. It’s not necessary most of the time but sometimes it can be quite handy.
November 15, 2014 at 21:31 #542Akira_SanParticipantYeah, will keep that in mind.
November 17, 2014 at 05:44 #545Akira_SanParticipantHow to parent a weapon to the hand? Looks like thats not possible, since the player gonna have to switch between them.
November 17, 2014 at 08:26 #546SponkKeymasterSimply create a new animation in Blender for every weapon (including your hand) and switch between those meshes.
You need a custom animation for every different weapon anyway so this would be a viable solution.- This reply was modified 10 years, 2 months ago by Sponk.
November 17, 2014 at 09:33 #548Akira_SanParticipantThx, i was not planning to animate the weapon, it was just going to be parented to the hand since the perspective is isometric. I guess in the future having a support for bones in the editor will do the trick faster.
January 11, 2015 at 16:41 #661MuryParticipantHey I have 3 questions
1)Where can i see the src for everything that is 2D?
2)Besides function onSceneUpdate is there something similar but for draw?
3)I have this code:dofile(“SDK/Graphics2D.lua”)
— Load a sprite
sprite = Sprite(0,0,180,40,”maps/human.png”, “”)— Add sprite to the main canvas
mainCanvas:addWidget(sprite)function onSceneUpdate()
— Rotate sprite by 2° every frame
sprite:rotate(2)
endwhy does it not show me my little spritesheet?
January 11, 2015 at 16:50 #662SponkKeymasterDid you use the project manager or the editor to install the new SDK?
It is not copied to your project by default since it is still under heavy development.Use the “Project > Import Lua SDK” menu to do that for your opened project.
After that you should be able to find a new directory named “SDK” in your scripts directory.
It should work then.The source code for the new API will be copied to the SDK directory, you can view and edit it there. Alternatively you could look in the git repo in “SDK/LuaApi” or on GitHub: https://github.com/Sponk/NeoEditor/tree/development/SDK/LuaApi
About the draw function: No, there is no dedicated draw function. The reason for that is that Neo is multithreaded and Lua is not threadsafe, leading to synchronization problems. This also allows the engine to do some optimizations that would not be possible otherwise.
January 11, 2015 at 17:22 #663MuryParticipantI`m just amazed by this engine.I really need to start learn it!
January 11, 2015 at 17:30 #664MuryParticipantsprite.position.x += 1 where can i get the delta time so my player wont move like crayzie?
January 11, 2015 at 17:33 #665SponkKeymasterFirst of all: Thank you 😀
You don’t need a delta time since onSceneUpdate is getting called at 60 Hz (every 16.6 ms) to be synchronous with physics and engine update. If you want to get the current time in ms you should use “getSystemTick()”.
More info: http://neo-engine.de/documentation/Lua/html/files.html
January 11, 2015 at 19:05 #666MuryParticipantI
m having a hard time moving sprites based on x,y.Can you provide me some examples?Because I
m planning in adding some collision detection sistemJanuary 11, 2015 at 19:17 #667SponkKeymasterYou can use “Widget:translate(x,y)” and “Widget:setPosition(x,y)” to do that. the Widget.position field is actually read-only. It will ignore new values written into there.
More info: http://neo-engine.de/documentation/LuaDoc/Widget.lua.html
Btw: Sprite is sub-classes of Widget and thus inheriting all methods 😀
-
AuthorPosts
- You must be logged in to reply to this topic.