# Text in interactive card

**URL:** <https://forum.code.org/t/text-in-interactive-card/34313>\
**Category:** CS Discoveries\
**Tags:** csd-unit-3-lesson-17\
**Created:** [February 28, 2021, 8:19pm UTC](https://forum.code.org/t/text-in-interactive-card/34313 "2021-02-28T20:19:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarah.dudley](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@sarah.dudley](https://forum.code.org/u/sarah.dudley)\
**Post date:** [February 28, 2021, 8:19pm UTC](https://forum.code.org/t/text-in-interactive-card/34313/1 "2021-02-28T20:19:51Z")

</div>

Student is trying to do a couple different things with text and for some reason I am struggling with this.

She woudl like the text “Click on the heart to see a surprise” to disappear when you click on the heart.

Then, when you click on the spacebar, she would like “Happy Valentine’s Day” to stay there without having to hold the spacebar down.

Are these things possible?

> **[Check out what I made](https://studio.code.org/projects/gamelab/S-uEZAD-sHDhoWSO79Ge89Od9dJN7XO8HmOlzanjDa8)**
>
> I wrote the code myself with Code.org

---

<div class="post-metadata">

**Author:** ![mwood](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mwood/32/4941_2.png) [@mwood](https://forum.code.org/u/mwood)\
**Post date:** [March 4, 2021, 3:09pm UTC](https://forum.code.org/t/text-in-interactive-card/34313/2 "2021-03-04T15:09:55Z")

</div>

@sarah.dudley

It’s a little tricky since the text isn’t a sprite. What I did was create a variable at the beginning called “textVisible” I set it equal to 1. Then, in the same place where the heart gets changed to a corgi, I set the textVisible to 0. Then in the block of code where you print the text, I just put that into a conditional block so the text will only display when “textVisible” ==1.

You could do something similar with the Happy Valentine’s Day text as well, so the space bar going down would change a variable from false (0) to be true (1) and the text would constantly display when the variable was true.

Give it a shot and if you can’t get it to work, we can try to assist further!

Mike

---

<div class="post-metadata">

**Author:** ![stephanie.pendley](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@stephanie.pendley](https://forum.code.org/u/stephanie.pendley)\
**Post date:** [March 31, 2021, 12:51pm UTC](https://forum.code.org/t/text-in-interactive-card/34313/4 "2021-03-31T12:51:31Z")

</div>

My student asked me this yesterday and he had a great solution. He changed the text size to 0 to make it not visible. Brilliant! Worked great!

---

<div class="post-metadata">

**Author:** ![mwood](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mwood/32/4941_2.png) [@mwood](https://forum.code.org/u/mwood)\
**Post date:** [March 31, 2021, 2:48pm UTC](https://forum.code.org/t/text-in-interactive-card/34313/5 "2021-03-31T14:48:53Z")

</div>

Yes! That’s another good way to do it!

Mike
