Change Stepper width / height from storyboard Xcode - uistepper

Is there a way we can change the stepper width / height from storyboard? Must I do it through the programmatic approach?

There is now way to change the size in Xcode 11.x. If you want to manipulate the size you need to implement it programmatically, e.g. by transformation:
stepper.transform = stepper.transform.scaledBy(x: 1.25, y: 0.9)

Related

How do I scale a Libgdx Animation?

I an currently using Libgdx Animation class( com.badlogic.gdx.graphics.g2d.Animation) in a game. However I need the animation to grow in size on certain events. How do I accomplish this?
Animation is used to select the correct frame (TextureRegion) based on the time elapsed. It has nothing to do with how you render that frame. Therefor it is not different as how you render anything else.
You didn't provide enough information for that. But usually you'd render it something like this:
TextureRegion textureRegion = animation.getKeyFrame(time += delta);
spritebatch.draw(textureRegion, x, y, width, height);
So to change the size would be to change the width and height variables. You didn't provide enough information on how you'd like to do that. But you can do that for example using this:
width = 0.8f;
height = 1.9f;

Actionscript 3, What is the difference is between scale and dimension

I'd like to know if I change the scale value, what happened to the object? I'm using flash air system.
I draw a movie clip box with 1000 x 1000px dimension.
I might change the size with 2 ways :
1st : Control of dimension with mc.with or mc.height
2nd : Control of dimension with mc.scaleX or mc.scaleY
Once I try to change the object with 500 x 500px,
Which one do you prefer : mc.width = mc.height = 500 vs mc.scaleX = mc.scaleY = 0.5
What is the benefit of using scale method?
Some good reading in the documentation here.
Basically they do exactly the same thing. It just depends on the case which one is easier for the developer to define in that case. If you know you need the result to be as wide as 212 pixels or the same width as object1 it makes sense to say
object2.width = 212;
or
object2.width = object1.width;
Let's assume you prefer to keep object2's dimensions proportional. You could then say
object2.scaleY = object2.scaleX;
without even knowing how many pixels that is or having another object of that same height to set it to.
The final note is this: if you change scale, dimension changes, and when you change dimension, scale also does change. In other words, setting scaleX to 1 will also set it back to its original width. Use them interchangeably. Use the one that is simpler for you in that instance.

Text scaling and positioning in libgdx

I am working with libgdx. I need to scale and position text. Let's say I want to draw X that is 30 pixels hight and I want it to be in the middle of the screen. I want to draw more of those in diffrent locations and with different scales.
Is there any way how could I achieve that? I can't find the solution anywhere. I dont want to create more BitmapFonts if possible.
If you want to handle all platforms (android, html, ios, desktop) you need to use several BitmapFonts in order to avoid ugly scaling. Otherwise, if you don't need to deploy to HTML, you can use the gdx-freetype extension (see here https://github.com/libgdx/libgdx/wiki/Gdx-freetype).
Assuming you go with BitmapFont, you can simply use code similar to this to center your text:
String text = "Your text here!";
TextBounds bounds = font.getBounds(text);
font.draw(batch, text, (width - bounds.width) / 2.0f, (height - bounds.height) / 2.0f);
For scaling, you can set the scale in font.draw, but you probably want several BitmapFont of various sizes to avoid ugly artifacts.

libgdx Shaperenderer line .. How to draw line with a specific width

I am trying to draw a line of specific width using libgdx shape renderer. I followed this link
The problem is if i specify more line width i.e more than 9 it does not show increased width. More than 9 either i specify 20 or 100 pixels it will have the same result as 9
shapeRenderer.begin(ShapeType.Line);
shapeRenderer.line(50, 70, 0, 50, 200, 0, Color.BLUE, Color.RED);
int lineWidth = 20; // pixels
Gdx.gl10.glLineWidth(lineWidth / camera.zoom);
shapeRenderer.end();
Thanks
Shakeel
To query the range of supported widths and the size difference between
supported widths within the range, call glGet with arguments
GL_ALIASED_LINE_WIDTH_RANGE, GL_SMOOTH_LINE_WIDTH_RANGE, and
GL_SMOOTH_LINE_WIDTH_GRANULARITY.
Reference
To avoid device specific behavior, I use a quad instead. Draw a 1x1 square from a small texture and then position, scale (depending on the width and height of the line you wanted to draw), color, and rotate it.
You should use ShapaRenderer.rectLine. You can see a more detailed answer here
Use this
shapeRenderer.begin(ShapeRenderer.ShapeType.Filled);
instead of shapeRenderer.begin(ShapeType.Line);
Replace 10 with line width you want
Gdx.gl.glLineWidth(10 / camera.zoom);

Autoscaling TLF Text in AS3

I'm needing an actionscript solution that will allow dynamic text to drop into a text box with pre-determined dimensions (x, y, width, height), and then will scale the text up or down so that it is as large as it can be within those dimensions without scrolling. Wordwrap would be automatic, and there would not be any paragraph breaks.
I have a working model using Flash's Classic text, but I would like to be able to utilize the in-line styling that TLF provides. I just don't quite have my mind wrapped around all the TLF features yet.
Does anyone know if there is an already existing solution to this situation - or could perhaps steer me in the right direction?
#phil: This should help: http://aaronhardy.com/flex/size-text-to-container/
Online demo, right click for source code.
Hm - this should work, but I am not sure over how precise the TLF font size is... Anyways:
newFormat:TextFormat = new TextFormat();
newFormat.size *= myText.width / myText.textWidth;
myText.setTextFormat(newFormat);
Now - this basically creates a TextFormat object and sets it's font size to myText's (the TextField) container width (the maximal width) divided by the actual text width. Again - if the TLF font size is NOT so precise, the size line must be:
newFormat.size *= Math.round(myText.width / myText.textWidth * 100) / 100;
100 means it is rounded to hundredths.
edit: I really believe this method is not only much simpler, but also efficient... I mean - that is the point of TextField.textWidth...