I am using libGDX for hobby Game Development,I am using two stages one is for graphics and one is for box2d world with debugDraw, every box2d fixtures debugDraw well with their graphics but I cant debugDraw a raycast!, how can I easily achieve that?
THANK YOU.
DebugDraw does not render RayCasts as they are not an object in the box2d world. It is more like a query and does not persist.
But you could use your starting vector and the the point of the RayCastCallback that is going stop the raycast to draw a line via DebugRenderer.line(a, b). Of course, if you want this line to show up more than one frame you have to store your vectors somewhere.
Related
Is there any efficient way of doing this? My screenshot from Android device
As for now I am reading accelerometer data
(all graphs are moving to the left edge of screen) and compare them with my black threshold.
When new accelerometer single data arrives, I plot all three values (red,blue,black). This means adding three new points to the correspondent series at the end and removing the first point from series (to enable 'movement').
Is there an option to avoid adding new points to the black graph (threshold) to make it plot in an efficient manner? Or maybe this is quite efficient option, huh?
There are many options to do graphing. If you want static graphing you can use these API's/code samples.
AChartEngine
Simple Line Chart
Draw a Graph
Charts4j
AndroidPlot - one of the best looking ones, does dynamic plots too and is now open sourced.
TeeChart
So many others to choose from but most are static and non of these can handle real time data plots, i.e. ECG wave forms. One example you might want to look at is the Tricorder android example. Problem it is really complex to setup and if you just want the graphs, there is so much code to rip out. It can be done but I even noticed there is a lag the longer you run the program.
So far the only way I have found a real good dynamic graphing, is to do it yourself and use the SurfaceView and then draw usin the path.lineTo() see below for previous SO answer for this solution.
SO example:
I've just learned about the capabilities of libGDX in terms of animation. I know how to use the texture packer,read atlases to be used animation, and use the animation class.
I use Adobe Flash to create animations and export them into PNG sequences then use the texture packer. But it fails when there are too many images to be converted. I tested it by using 80 images(600X600). I was trying to rotate a big magic circle.
My question is, what are the other methods to create animation? What is the best way to create PNG Sequences?
EDIT: I used the TexturePacker-Gui:
http://www.aurelienribon.com/blog/2012/06/texturepacker-gui-support-for-multiple-packs/
and was able to pack my sprites into an atlas..Clicking 'Pack Selected' instead of 'Pack Em All' did the trick (maybe a bug for the program). And rotating that magic circle by sprite animation was a big mistake. The only question that remains is if there is any better way to create animation other than using Flash?
I have some tool form create spritesheet.
I didnt use this one
libgdx-texturepacker-gui, maybe you can try.
I am using this Texture Packer
If you want to just rotate something you don't need animation. You can create a Sprite using only one image and then do something like sprite.rotate(...);
I am trying create a "real-time" plot using MonoTouch graphics i.e. the app calls a web service to get data and then plots it on a chart based on time and y-values. I can get the frame and axes of the chart working but I can't figure out how to update the chart with new data points - without redrawing the entire chart from scratch. The data simply needs to be drawn on top of the underlying chart frame - like drawing on a 'canvas'.
I have created this type of chart on Android using the canvas and it's quite simple to do. But there does not appear to be anything like a canvas on iOS.
Any suggestions about the approach I should use with MonoTouch to create this type of chart?
Thanks
Mike
use core graphics with monotouch.
http://developer.apple.com/library/ios/#DOCUMENTATION/CoreGraphics/Reference/CoreGraphics_Framework/_index.html
I am trying to learn game programming using AndEngine. I have created animated sprites that are spawned on different intervals. I would like them to shoot objects at my player. I have searched trying to learn how others have done this, and tried the code that i thought would get me started, but have been unsucessful. Can someone pleae point me in the right direction to accomplish attaching a child sprite and having it shoot at different intervals in AndEngine.
thanks in advance!
You don't need to attach bullets as child, here is the very good tutorial and it's shooting bullets :), You're in luck!
I am using AndEngine to create a Test run project.
I am doing well so far. The only problem i run into is when using Tiled map editor and i load the tmx. file into the project. The map is loaded correctly, but i am having trouble understanding how the whole tile piece works. How would you go about positioning a Charactor or a object on a specific area of the map like if you have a grown how do you set place the object on the top of the ground for a side scroller type game?
And also is there collision detection so if the character is on the ground then it does something?
Thanks for all the help!
read this example my friend, it will help you
Andengine tutorial and example