Questions tagged [gravity]

The concept of UI widgets being dragged to a specific side of a surrounding element.

The concept of UI widgets being dragged to a specific side of a surrounding element.

Do not use this to refer to accelerometers (gravity sensors) in mobile phones. Use accelerometer instead.

832 questions
0
votes
1 answer

Player won't fall down

The Problem: So I'm making this 2D platformer game and have run into a problem. When the player jumps onto a platform and goes of it gravity doesn't affect it and it won't fall down until you press the jump key again, it's like it thinks it's still…
user2274889
  • 371
  • 1
  • 4
  • 7
0
votes
3 answers

Android - Set gravity of elements in XML

This is the XML code:
Gimmy88
  • 295
  • 2
  • 5
  • 13
0
votes
1 answer

TextViews Gravity does not work vertically

when i draw the DrawingCache of a TextView to another View's Canvas, the Gravity of the TextView has no effect in vertical direction. Here the class drawing the TextViews canvas to own canvas: public class GravityDecorator extends View{ private…
steffka
  • 5
  • 2
0
votes
0 answers

BitmapDrawable aligned as background

I'm wondering if it's possible to align the background of a View in android. I have an image as a BitmapDrawable that I would like to fill and align it's right edge with the View. I was using the Gravity.CENTER value in order to keep the…
RileyE
  • 10,874
  • 13
  • 63
  • 106
0
votes
2 answers

Optimization - Python and Scypi.minimize

I would like to find the position [X,Y,Z] of several elements in order to have the global center of gravity at a desired point. To do so, I defined 2 classes: elements which store the element's mass and position plane which takes a list of element…
CrH
  • 1
  • 1
0
votes
0 answers

How would i add gravity to a ball that bounces?

I would like the ball in the code below to bounce according to gravity. at the moment, it bounces around a frame of the walls. I am making a version of angry birds, so gravity is key. I have some idea that uses quadratics to make a parabola that the…
0
votes
1 answer

Calculating X and Y speed

I am trying to calculate X and Y speed for small object that are attracted by gravity of one big object This is video how my calculation works. As you can see after a while every small object goes into one point. I want achieve moves like in this…
kubaj
  • 63
  • 1
  • 7
0
votes
1 answer
0
votes
2 answers

Android Progress Dialog isnt in the center but bottom

I've searched everywhere, and nothing found! I need to set the position of my progressDialog in the center horizontal and vertical. But when i compile my code by command line (i dont use eclipse) an error message is shown: "cannot find symbol >…
N4pst3r
  • 646
  • 1
  • 10
  • 27
0
votes
1 answer

gravity form notification customization

I have built a gravity form in wordpress. I have around 20 text fields. but when I submit the form then i see all 20 fields in the email. But I want to show only those fields in email which has values if there is no value in any field then it should…
akhan
  • 63
  • 1
  • 3
  • 10
0
votes
2 answers

How do I make TextView's text to the left in a one row with two TextView?

I would like to use a LinearLayout to position two TextViews' texts to the left in a single row . One TextView on the left hand side, the other on the right hand side. whole rows texts will be on the same line as vertically. Here is my XML:
0
votes
2 answers

android TextView setGravity doesn't work for certain versions

Setting gravity on a textView doesn't work on my Galaxy 2, 2.3.3 but does work on my Galaxy Note, 2.3.6. Does anyone have an idea why? The TextView xml definitions:
n00b programmer
  • 2,671
  • 7
  • 41
  • 56
0
votes
1 answer

AS3 Juming/Gravity issue

The problem I'm having is that I don't know how to make the character stop jumping. For example, when I constantly hit space it keeps jumping and jumping. When I press space I want it to jump and while the MC is jumping I want to disable the space…
user1666767
  • 117
  • 3
  • 13
0
votes
2 answers

Remove Some Text From a String

I have a PHP variable that outputs some text on the page i.e. here's the text it outputs http://URL.com/uploads/gravity_forms/3-464e6bdac9890814218993b7e45c1736/2013/01/hehehecsv10.csv I would like to remove everything from this text and only show…
0
votes
2 answers

Frame rate independent gravity

I am having an issue with gravity varying severely with frame rate shifts. When I run at 160 fps, my player jumps a few meters in the air then falls, but at about 10 fps, my player jumps half a meter then falls. My code for gravity is as…
CoderTheTyler
  • 839
  • 2
  • 11
  • 30