Calculator Project
-
Hello everyone!
I've finally managed to build the calculator with my own fingers and brain.
I understood the logics behind the operations and especially the input to the label component.I'm getting excited to improve it just a little bit, and by that I have 3 questions:
-
How can I use the operational button as "switches" where only on sign can be accepted by the input for each operation (23 +- 21, I do not want this to happen).
-
Is there a way to not "show" the operational sign to the label without affecting the input?
-
Is there a way to reset the label after first addendum and operational sign have been selected? In that case the label would be blank waiting for the second addend.
Any help is appreciated, hope there's a way that doesn't require too much code, but by what I'm thinking, conditional statements are key to make these work.
-
-
Trying to style this calculator here, I'm working on the customisation of the buttons.
I just want to set an animation that once a number is pressed, a background pops up and scales itself while fading thru opacity, (just like website buttons).I'm currently running with 2 issues:
-
As shown in the video , once the mouse is gone, the buttons background goes away but the buttons frame remains until I press another button.
-
For the scaling and fading implementation, I've tried to set a Timer where the opacity of the background fades in 1000 milliseconds. It didn't work on the
if(obj.down) functions/Conditional Statement. Also want to know if there is a way to scale the rectangle by x.
Any Help is super appreciated. I'm so far happy of the improvements, just wanna add this little UX feature.
-
-
@Sawer Is that individual buttons or are you using a panel? You should be using a panel really.
-
@d-healey Yes, True. That's what I'm working on now. almost done!
-
@d-healey
Watched your "Panel Timers" Youtube video. Thanks soo much for this.
I'm currently having problems on running the timer. This is the snippet. IfHiseSnippet 1428.3ocsWrsaaaCUJMpn1aEXcXe.D9gAYfTG41ltgEzsV6D2kslTi3tt9VAsDsEQoIMHoRrWQ+m2ev14PIYIm3lkZfIjHSdtvyEdtogZULyXTZO+FuY4blm+WGLZozl1Okxkdmbjm+2FzKyZURxKj7YTKWI85sbN0XXId9924kHc9M10y872+ROpfJiYUf77dqhGydEeF2VAc3y+ctPLflvdCeVMpexyOIVI6qDpLPmtSPj2bZ7GnSYmQQx1Ivy+tGmvsJ8HK0xL.M8TIKGkptTlS+a4F9XAC2z0aDbP4f85mxEICKsWimm+tCqr96ja8eWvo7D9J3UdguwgfTwQcef+N2jJ08KPk7qoR6lqROHXTrlO2VgA0muJ3DokomPAWccUImVuc5cuf9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vwUv0WeHHuhgAfU+wIXONbtnBXUs9AXGwt.FrLeJoFAGwLe.5N4nc1b3VQhiaZcXue4LTXyCONH5f.3twaArvOADzxxEtAI.9taRwvq4yQTGx5iQfiFt9TDdiU5DldDTLp9Tv4POmlvyL0g6c8Q9fgMUIYBpc8IPwQsKPb0ovwQ6jFnzb8Qw+BFKM5FGK81phOHXH2FmtYcbmMnivM6+G5Xwv72O33ISfROUJ3tACd21N49+g3ymbY5oTqligUmkMaDzSLlARWBQcFLBaGL5NeeDtG8.iXxD2l+AdJP1E26WfraIRuYzXs58w4Ys3mKbOGDPmjtuNpQvo3dRWOWlLFkG0IxaF7kKuONFM+GBIbalmGsE773sfmmrE7bvVvyS2Bd9gsfme7F4A+nwWjYUEe3L.X3wtRZ99GKoPjkKJz6eAAGCS6
The code is a little bit messy (Iteration purposes) but I've put some comments for more clarity. Any help is super appreciated.
-
@Sawer What's the problem? Are you using develop branch?
-
@d-healey Yes, I am.
the problem is that when I click the panel, the Console says this "Accessing parameter reference outside the function call" So I do not really know where to place the parameter. -
@Sawer You need to use a different variable name
-
@d-healey Thanks so much man. It's working now.
Want to ask if its possible to ad in the same timer a state where the opacity also fades.. the issue is that the counter goes up to scale the background, but the opacity starts from 1 and goes to 0 with an interval of 0.1, while for the background is of 1.
Any Idea please? -
@Sawer Divide by 10?
-
@d-healey Thanks . will try
-
@d-healey It works. Thanks!
-
Alright, almost at the finish line. Tried to implement the button animation by creating it from a panel. I'm having to issues:
- Just like a normal button, when it's clicked and released , the background frame still remains until another button is pressed(maybe is because of the transparency)
- Secondly, only one button(the last) can do the animation, the rest if clicked won't do anything even tho the counter works.
Am I missing something?
Any help is super appreciated! thanks. -
@Sawer Your image is too tiny, I can't read any of the code. Post a snippet.