Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Tekst
- pierrepelzer
-
Scratcher
100+ posts
Tekst
Can I put a tekst in an project without using a tekst-balloon?
- PutneyCat
-
Scratcher
500+ posts
Tekst
Yes - if you search for “pen text engine” you'll see numerous projects that display text without using the built-in speech bubbles.
- pierrepelzer
-
Scratcher
100+ posts
Tekst
Oké, but I don't understand how I can use it.
I would like to make a list with words that will appear one by one when I press a certain button.
See my project 50-50.
Now I used a lot of different costumes for the questions and the 2 answers.Making new questions is as difficult and time-consuming as the first time.
When I could work with lists, it would be a lot easier.
Is this possible?
I would like to make a list with words that will appear one by one when I press a certain button.
See my project 50-50.
Now I used a lot of different costumes for the questions and the 2 answers.Making new questions is as difficult and time-consuming as the first time.
When I could work with lists, it would be a lot easier.
Is this possible?
Last edited by pierrepelzer (July 24, 2020 19:10:28)
- gor-dee
-
Scratcher
1000+ posts
Tekst
Most text engines are contained in a sprite that you can backpack and import into your project. They use a custom block to write, usually with an input for the text, an inputs for X & Y positions. You can use a global variable “question number” to point at which question to ask from your list and use broadcasts to tell the text engine to write. So
set [ question number v] to [3]and in the text engine
broadcast [new question v] and wait
define Write(text)(X)(Y)
when I receive [new question v]
Write (item (question number) of [questions v] :: list) (25)(100)
- pierrepelzer
-
Scratcher
100+ posts
Tekst
I think I'm going to us PTE ultra+
Looking for a project that uses this text engine so I can learn a bit faster.
Looking for a project that uses this text engine so I can learn a bit faster.
- gor-dee
-
Scratcher
1000+ posts
Tekst
Sometimes using pen can make the text fuzzy due to anti aliasing which can make small text difficult to read. I used a pixel text engine in this project https://scratch.mit.edu/projects/160796594/ by @MCAnimator3D which is really good for small text. The original project doesn't appear to be working but you can backpack it from my project and delete all the
You will probably encounter another problem using this (or any other) text engine. If you use a long line of text it won't ‘wrap’ to a new line where you want it to but this can be easily solved….but first choose which text engine to use.
when I receive [ v]scripts.
You will probably encounter another problem using this (or any other) text engine. If you use a long line of text it won't ‘wrap’ to a new line where you want it to but this can be easily solved….but first choose which text engine to use.
- pierrepelzer
-
Scratcher
100+ posts
Tekst
Thanks Gor-Dee,
Where is the text engine in you project, I can't find it.
But I dom't need small text, so I think I'm going to use the PTE Ultra+ engine.
Now, how to make a longer text in two or more lines?'
And, when I use this engine the text appears always in the background. I would like to place it on a collard square, so I could give an answer bij clicking that square.
Lot of questions, hope I don't bore.
Gr.
Where is the text engine in you project, I can't find it.
But I dom't need small text, so I think I'm going to use the PTE Ultra+ engine.
Now, how to make a longer text in two or more lines?'
And, when I use this engine the text appears always in the background. I would like to place it on a collard square, so I could give an answer bij clicking that square.
Lot of questions, hope I don't bore.
Gr.
Last edited by pierrepelzer (July 26, 2020 11:49:38)
- gor-dee
-
Scratcher
1000+ posts
Tekst
Happy to help!
Text engine in my project is the second sprite “bitmap….” it uses costumes and stamping which, like pen, will always be in the background. To make it appear on a square you must either use a square drawn on a backdrop or use a transparent square (just a frame). To make it appear on top of a sprite you would have to use clones, which limits you to 300 characters but this should be enough for your project I think and might be the best solution.
Text engine in my project is the second sprite “bitmap….” it uses costumes and stamping which, like pen, will always be in the background. To make it appear on a square you must either use a square drawn on a backdrop or use a transparent square (just a frame). To make it appear on top of a sprite you would have to use clones, which limits you to 300 characters but this should be enough for your project I think and might be the best solution.
- pierrepelzer
-
Scratcher
100+ posts
Tekst
That clone-part I don't understand. Just a few hints.
Ans what about 2 or three line?
.
Ans what about 2 or three line?
.
- gor-dee_test
-
Scratcher
100+ posts
Tekst
I've made a remix of “my” text engine here https://scratch.mit.edu/projects/413989104/
I've changed from stamping to clones and added a wrapping feature, just set the max number of characters per line. There is a ‘test’ sprite to show how to use it (just click the button). You can change the size and line length in the “Write” custom block or you could use variables here too if you want.
I've changed from stamping to clones and added a wrapping feature, just set the max number of characters per line. There is a ‘test’ sprite to show how to use it (just click the button). You can change the size and line length in the “Write” custom block or you could use variables here too if you want.
- pierrepelzer
-
Scratcher
100+ posts
Tekst
THANKS
It works perfect.
Just to make me understand:
in your sprite there are several variables that have no value. p.e. Make Word (empty)
Why is that?
You wrote that you changed from stamping to clones; where can I see that?
But most of all thank you.
It works perfect.
Just to make me understand:
in your sprite there are several variables that have no value. p.e. Make Word (empty)
Why is that?
You wrote that you changed from stamping to clones; where can I see that?
But most of all thank you.
- gor-dee
-
Scratcher
1000+ posts
Tekst
Yes, ‘line’ and ‘word’ are set to empty but where it tests if
the script works by building up a word letter by letter until it finds a space. Then it adds it to the line if it isn't too long, or starts a new line if it is. Hope that makes sense!
In the custom block “Render” you will find
I've just seen a small problem, that would occur if you broadcast “write” more than once without clearing (which you might want to do if you want writing in more than one place). The clones from the first ‘write’ will all react to the second ‘write’. I will fix it in my project by adding another variable “clone?” to distinguish between clones and the original sprite.
<(letter (index) of [text]) = [ ]>what looks like empty is actually a Space (i.e. “ ” not “”)
the script works by building up a word letter by letter until it finds a space. Then it adds it to the line if it isn't too long, or starts a new line if it is. Hope that makes sense!
In the custom block “Render” you will find
create clone of [ myself v]this was “stamp” in the original. I have also added
when I start as a cloneso that the letters show, and
show
when I receive [ clear v]to erase.
delete this clone
I've just seen a small problem, that would occur if you broadcast “write” more than once without clearing (which you might want to do if you want writing in more than one place). The clones from the first ‘write’ will all react to the second ‘write’. I will fix it in my project by adding another variable “clone?” to distinguish between clones and the original sprite.
- pierrepelzer
-
Scratcher
100+ posts
Tekst
When I was making some qustions of my game, I wanted to us a word with a ë. I do miss the possibility to make letters with a trema (ë, or i" or ä or ö or ü)
What can I do to make these letter combinations?
What can I do to make these letter combinations?
- gor-dee
-
Scratcher
1000+ posts
Tekst
You should be able to do this, just add some more costumes with the trema
- pierrepelzer
-
Scratcher
100+ posts
Tekst
Thanks. I did make the letters with the trema. Only the capital Ï doesnt do what I want.
Maybe there will be more questions. Hope y're not anoyed.
Maybe there will be more questions. Hope y're not anoyed.
- pierrepelzer
-
Scratcher
100+ posts
Tekst
Please help.There's a bug in the project, ( https://scratch.mit.edu/projects/414207627 ) that I can't find.
What happens:
- Hit the green flag
- Hit “Start”: All list with questions and answers are generated
- Hit “Vraag”: Gives the next question. (Just to make it quicker to come t number 50, I started with 45) and the two possible answers A and B
You text engine works perfect.
When text Answer B is generated, it goes wrong. Since two days the backdrop changes in complete yellow.
I can"t find why.
Please help.
What happens:
- Hit the green flag
- Hit “Start”: All list with questions and answers are generated
- Hit “Vraag”: Gives the next question. (Just to make it quicker to come t number 50, I started with 45) and the two possible answers A and B
You text engine works perfect.
When text Answer B is generated, it goes wrong. Since two days the backdrop changes in complete yellow.
I can"t find why.
Please help.
- gor-dee
-
Scratcher
1000+ posts
Tekst
@deck26 is right, you must have accidentally filled the ‘0’ costume with yellow. Just fill it with transparency and it works.
- pierrepelzer
-
Scratcher
100+ posts
Tekst
Thanks for the tip deck26 and gor-dee. It was very easy to repair this bug, but…
Aahhggrrrrr
Now when a question has to appear in the grey box, it doesn't. It is only there when I move the box away so it is under the box where it should be on top of it.
I don't know what I did wrong and I don't know how to fix it. Changing the box to the background doesn't help.
Wat did I do wrong?
Aahhggrrrrr
Now when a question has to appear in the grey box, it doesn't. It is only there when I move the box away so it is under the box where it should be on top of it.
I don't know what I did wrong and I don't know how to fix it. Changing the box to the background doesn't help.
Wat did I do wrong?
- Discussion Forums
- » Help with Scripts
-
» Tekst