How to change text size of TextMobject in Manim - manim

I hope you are all doing great!
I am wondering how to make text smaller in manim.
I know you can do text.scale(0.8), but I want to know how to do it after it has been used.
For example,
text.scale(0.8)
self.play(Write(text))
makeSmaller(text) <-- what I'm looking for
So far, I've tried ApplyMethod(text.scale(0.8)) with no success.
Thank you so much
Edit:
Ideally, I do not want to create two different TextMobject's and then transition between two animations.

It is:
ApplyMethod(text.scale, 0.8)
or
self.play(text.scale, 0.8)
More info here

Related

I cant figure out how to get background colour in turtle python to work

I've been trying to figure out how to input background colour for a day or two now.
I have been given a booklet to work through as I learn however once I reached the chapter on setting a screen size or background colour, it simply wont work.
I was told to use the code bgcolor("colour here") and when that didn't work, I searched online and found turtle.bgcolor("colour here") which didn't work either.
All I get back is an error saying the names aren't defined. setup(number 1, number 2) was also coming up with the same error but i couldn't find a substitute to it online. Could somebody please help me?
my teacher said just fill a shape for the background but I feel like it would feel more achieving if I figured it out instead. Thank You
below is a few clips of my codes.
You need to change from turtle import* into from turtle import * (extra space)
So your code will be:
from turtle import *
setup(800, 500)
bgcolor("black")

using excel to show Increase, Decrease and no change in Multiple colours

Looking for some help or to be pointed in the right direction. Been stuck on this for a while and the main issue is I don't even know where to start. I am sure there is a solution but my brain will not see it.
To use as an example I have a table that shows monthly results for multiple different areas:
What I want to do is in the gap along side each number is show an increase, decrease or no change, using up arrow down arrow and square. That I can do using conditional formatting my issue comes with the fact that I also want it to be multiple Colours. So it will take into account increase and decrease and whether they are in target.See below:
Atm I am copying and pasting each month. But having it automated would be amazing. The outcome would hopefully look like this:
I am hoping there is a way that I can do two things compare to the previous month and then check it against my table to see where it sits then display the appropriate symbol.
Thank you in advance for any help or a place to start.
So extremely easy to figure out once I looked at it in a simplistic way.
Firstly, I used: =IF(-SIGN(E26-G26)= 0, "n", IF(-SIGN(E26-G26)=1, "é", IF(-SIGN(E26-G26)=-1, "ê","")))
To compare the current number to the previous number and get a 1, 0 or -1 depending on if it had gone up down or stayed the same, using this it either displays é, n or ê. I then set the font on these cells to Wingdings. so they become up arrow, down arrow and a square.
Then I use conditional formatting to colour it based on the adjacent cells value.
No need for a long, complex formula
=IF(A2>A1,"t",IF(A2<A1,"u","v")) - set the font to Marlett

How to adjust the bubble margin of the JSQMessagesCollectionViewCell

Here, I'm using tailed and tailless bubble image for the incoming and outgoing messages. The (code for the) cell for the outgoing and incoming are pretty much alike. But, as you can see in the image, the bubble for the tailless incoming message is slightly off to the left. How can I adjust this?
I'm still learning the library but any help quick help is very much appreciated. Thanks!
try this
in fund viewdidload
self.collectionView?.collectionViewLayout.incomingAvatarViewSize = CGSizeZero
self.collectionView?.collectionViewLayout.outgoingAvatarViewSize = CGSizeZero
Hey #yoninja I think what you are looking for is adjusting the _messageBubbleLeftRightMargin I found it in the JSQMessagesCollectionViewFlowLayout line 73.
Technically the bubbles are lining up edge to edge(of the tail) So you are going to want to make something that returns a different _messageBubbleLeftRightMargin based on wether or not it is tailed or not. This should help you get where you wanna go. 🛠👻

Changing text adjustment in UIView using swift

I've been trying to create my app and something is bugging me very much,
I have images of what I am trying to achieve:
1)
2 )
number 1 shows what I am trying to do, the letters are "squeezed" together making the text appear tighter with a short width even though the letter sizing is big.
number 2 shows my attempt to achieve this, I tried multiple different ways to get that same look but failed for hours, does anyone have any suggestions or know how to make the text look like that in the first picture?
I appreciate any help, thank you!
The only way how to do it AFAIK is to use transform on UILabel, like this:
let widthTransform = 0.8 // Shrink label to 80% of its width
label.layer.transform = CATransform3DMakeScale(widthTransform, 1.0, 1.0);
Hope it helps!
Note* that transform work for about 30% of decrease (even less imo), then it just starts to look very bad. You can also change text spacing, but if you calculate it dynamically, you could end up with negative one and that looks terrible. The easiest way really is then just change of the design :)
Options:
You can decrease character spacing like in this answer
and increase font size.
Having fun with transformation on layer is really awful idea, as later you won't be able to get the height of text etc -> just everything will be working wrong.
You can also just use different font.

Create jQuery Slider Range With One Handle Not Using Min/Max

Is there any possible way to create a slider that will create a range similar to what is done with one handle using min/max, only instead of min/max, starting the range from say 50 (on a scale from 1-100)? I realize this will most likely require modification of the slider or creating a plugin, just wondering if anyone has done this already or knows how to go about it.
I.e. something like this: http://jqueryui.com/demos/slider/rangemin.html
Only, instead of the range going from the min, going off of where the handle is, and allowing the user to slide either left or right of that fixed starting point to create the range. Any help is appreciated, and I'd be glad to clarify what I need if that doesn't make sense! :)
I'm not sure I understand the question. You want something (what?) to be based on the initial position of the slider "thumb"???

Resources