| bio | website | |
|---|---|---|
| location | ||
| age | ||
| visits | member for | 2 years, 1 month |
| seen | May 14 at 13:44 | |
| stats | profile views | 47 |
|
Apr 26 |
comment |
onTouchEvent only working for one view within activity Yes, it explains exactly what happens in this case and how to do it correctly. |
|
Apr 24 |
answered | onTouchEvent only working for one view within activity |
|
Mar 29 |
comment |
How can I control the frame update rate of a thread? It is correct that your game thread calls two blocks one for claculation and logic like update() and the other one drawing, that is how the games are done. I use ArrayLists, they are easier to control, add and remove objects etc. In a loop one just checks their size, but they cannot be null. You can also use a boolean flag or an integer constant like final int GAME_MODE_START = 1; so if (gameMode == GAME_MODE_START) then do some things and not do something else... |
|
Mar 28 |
answered | Android bitmap placing |
|
Mar 26 |
comment |
How can I control the frame update rate of a thread? When it comes to the refresh rate, for the purpose of quality and smoothness of animation the best is to keep it at 60fps. Remember that your UI thread should not do any operations on objects in the Game thread, but only inform it what to do via variables, so these two threads will never get in conflict. |
|
Mar 26 |
answered | How can I control the frame update rate of a thread? |
|
Mar 14 |
awarded | Popular Question |
|
Mar 12 |
answered | How to scroll background image-Android App |
|
Mar 12 |
awarded | Benefactor |
|
Mar 12 |
awarded | Nice Question |
|
Mar 11 |
comment |
Converting a 2D curve into points for data storage @msell, see the image - source path is a result of getBoundaryPath(), destination is result of my path extracting algorithm. Intially I had a perfect circle and rectangle. |
|
Mar 11 |
revised |
Converting a 2D curve into points for data storage added 77 characters in body |
|
Mar 11 |
comment |
Converting a 2D curve into points for data storage Also because the points p0-p3 are chaotically placed around the curve I don't think the cubicTo or quadTo should use any of them as a point through which the line should pass. |
|
Mar 11 |
comment |
Converting a 2D curve into points for data storage Because the rest of my app is using one control point, can you post a solution with the one control point as well for quadTo. I can then see what works best for me. By the way thank for making this effort, you definitely deserve the points! |
|
Mar 11 |
accepted | Converting a 2D curve into points for data storage |
|
Mar 11 |
comment |
Converting a 2D curve into points for data storage I am not very good in converting some abstract math to java code. Can you suggest some code which would calculate a spline point from the points I get from pathMeasure. Then, as you said I could convert these points into android quads so I can easily reload the path from a file. |
|
Mar 11 |
comment |
Converting a 2D curve into points for data storage When I try to combine paths, like have a union of circle and square, then Android seems to convert them into bitmap regions first, creates a union and then converts it back into an non antialiased path i.e. a path with small steps on its curved parts. If it was just one curve then yes I could use splines, but for a complex shape which combines curves and straight simple shapes, I don't think I can just draw a spline through the given points from pathMeasure. The algorithm would have to distinguish between straight lines and curves. |
|
Mar 10 |
comment |
Converting a 2D curve into points for data storage The question is about converting a curve into points, not saving it. But thank you for this reference, it is good to know about SVG standard. |
|
Mar 10 |
comment |
Converting a 2D curve into points for data storage Unfortunately, after more testing I've found that because Region uses pixels which the path would occupy when drawn, the app easily runs out of memory if the scaling of the Path is big and done repeatedly. So this solution is limited & risky, but good to keep in mind. |
|
Mar 9 |
comment |
Converting a 2D curve into points for data storage Amazingly, this simple trick solves two problems: firstly it makes the resulting path of intersection or union smooth and secondly my code in the question when sampling this same scaled-up path produces a perfectly smooth result. What an unexpected and simple solution, thank you! |