I am struggling to figure out this code

Hello everyone, I am currently working on a project for class and could really use some assistance. We are using the canvas function for the first time and we are tasked with creating an app that allows us to change the line width of the drawing lines. The idea is every time we hit the plus or minus buttons, the text of the label and the line width is supposed to decrease and increase, however I have hit a road block and could use some help.

the minimum line width is 1, the maximum is 10 and the normal length is 5, I have them all set to variables! any help that anyone could provide would be greatly appreciated! thanks everyone!

1 Like

Hello Jared - you haven't explained the road block, but I imagine the issues are going below the minimum line thickness and going above the max.

Like this: (Use TinyDB to record the current line thickness/width such that when the User returns to the App, that value can be restored).

2 Likes

Thank you so so so much! That was exactly what I needed to do!
I hope you have an amazing rest of your day!!!

1 Like

Hello Jared

Actually the Screen initialize code should use your variable and not be hard-coded (with '5') like this:

1 Like

.... it is using a Label

1 Like

Sorry, didn't notice actually. :sweat_smile:

Deleting that post.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.