Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: nemo on June 30, 2010, 12:02:09 pm

Title: Pop ups in axe
Post by: nemo on June 30, 2010, 12:02:09 pm
how does one make a pop up? as in you have a screen on-calc, the user presses a key and a little window pops up with something to display, then goes away and the same screen before the pop up comes back.

i can think of a way to do it with StorePic, but that'd corrupt my data in L3.
this is for my tilemapper. basically, i have tiles in L3. i want to make a pop-up menu to decide which tile you want to place. i need to save the buffer data to a temporary area, draw the pop up menu to the buffer, let the user choose a tile, then recall the data in my temporary area that holds the buffer data before the menu. is there any way without using StorePic or RAM areas L1-L4?
Title: Re: Pop ups in axe
Post by: DJ Omnimaga on June 30, 2010, 12:52:16 pm
you would need to use a combination of both line(), sprites and pixels to draw them from a sub-routine. In the future, there will most likely be geometry drawing making this easier, though.
Title: Re: Pop ups in axe
Post by: SirCmpwn on June 30, 2010, 01:07:59 pm
What I would use is StorePic to save the current screen, then draw your window on top of it with some lines and text and such, loop through the window code, and use RecallPic to bring the old screen back.
Title: Re: Pop ups in axe
Post by: Builderboy on June 30, 2010, 01:11:02 pm
Except for the part where he said he can't use StorePic.  Well the easiest way to backup the screen would be to add on 768 bytes to your program and store it there.  You could also create an appvar of 768 bytes and store it there.  Also, if your popup does not take up the entire screen, you can backup only the part that you overwrite to save memory
Title: Re: Pop ups in axe
Post by: SirCmpwn on June 30, 2010, 01:15:54 pm
If he does that, he can't package it as an application, and I personally think that this kind of program would work well as an app.  Maybe he can use the backbuffer?  Or create a 768 byte AppVar and temporarily dump the data in there?
Title: Re: Pop ups in axe
Post by: nemo on June 30, 2010, 01:16:06 pm
Sir, I have tile data in L3. Writing to the back buffer corrupts the data in L3. StorePic transfers the buffer to the back buffer. do you see my problem? if i us StorePic, my tile data in L3 will be corrupted.

new idea. make a large, white bitmap and display that where i'll put my menu. then make bitmaps of all the tiles, display those and have the user select from there. also have a bitmap for a cursor the user to move around and select the tile. then display the white bitmap again, and DispGraph. unless Bitmap() updates the buffer... then i can't do that idea.
Title: Re: Pop ups in axe
Post by: SirCmpwn on June 30, 2010, 01:18:20 pm
Well, I think you can have Bitmap update the LCD, not the buffer, but it will be slow as hell.  My opinion is not to use SMC, because it will make it so you cannot use it in an App, which would be very nice.
Title: Re: Pop ups in axe
Post by: nemo on June 30, 2010, 01:24:37 pm
i don't think it'll be very slow.. considering all i'd be doing in the loop is checking for four keypresses, and drawing a bitmap cursor to the LCD. i'll probably use builderboy's idea of just adding 768 bytes to the program and storing it there. also, i don't think i'm going to make this an app. it's only ~2300 bytes right now, and although there's a lot of features to implement some seem relatively easy.
Title: Re: Pop ups in axe
Post by: FinaleTI on June 30, 2010, 01:53:57 pm
When he said it would be slow, I think he meant when the bitmap was drawn, because drawing directly to the LCD is extremely slow when compared to drawing to the buffer.
Title: Re: Pop ups in axe
Post by: DJ Omnimaga on June 30, 2010, 01:55:48 pm
I think bitmaps can be set to be stored the buffer, though (Fix 8 or 9, I think, right? And not forget to revert the change on program exit).
Title: Re: Pop ups in axe
Post by: nemo on June 30, 2010, 02:00:37 pm
DJ, they can. but drawing to the buffer is what i was trying to avoid in that scenario. anyway, i've figured it out. it added 1400+ bytes to my program size though  :-\ i'm not completely sure it's worth it.
Title: Re: Pop ups in axe
Post by: SirCmpwn on June 30, 2010, 02:02:25 pm
/me shrugs
If it gets too large, I still say package it as an app.
Title: Re: Pop ups in axe
Post by: Quigibo on June 30, 2010, 03:39:17 pm
Is is not possible to just redraw the screen after the pop-up appears?  Especially becasue you say this is for a tile mapper, I would think it would be easy to call a "Redraw" subroutine that clears the screen and redraws all the tiles.  Then you don't need to worry about extra buffers.  Speed wouldn't be an issue becasue the redraw would only be needed when exiting the pop-up.
Title: Re: Pop ups in axe
Post by: nemo on June 30, 2010, 03:41:30 pm
wow. i feel really stupid right now. thanks quigibo. thing is, i already had such a routine in my program too, for navigating between editing tiles and editing the map.
Title: Re: Pop ups in axe
Post by: shmibs on June 30, 2010, 05:06:11 pm
glad to see the problems solved. if you ever have to do this kind of thing again and cant just draw back over everything with tiles it's easy enough to split the data amongst the smaller Ls using the copy function and just avoid text drawing/archiving or whatever
Title: Re: Pop ups in axe
Post by: LordConiupiter on July 01, 2010, 11:03:41 am
perhaps u should create an appvar from 768 bytes, and store the current screen there temporarily???
Title: Re: Pop ups in axe
Post by: ztrumpet on July 01, 2010, 11:08:26 am
I think the problem's been resolved now. :)  He's just redrawing the whole screen upon the exit of a pop up. :D
Title: Re: Pop ups in axe
Post by: nemo on July 01, 2010, 11:15:10 am
exactly, thank you ztrumpet. although there will be an appvar for saving tilemaps and their corresponding tilesets.

offtopic, ztrumpet i'm working on a new exodus level (:
Title: Re: Pop ups in axe
Post by: ztrumpet on July 01, 2010, 11:16:59 am
exactly, thank you ztrumpet. although there will be an appvar for saving tilemaps and their corresponding tilesets.
Cool. :D

[offtopic]
offtopic, ztrumpet i'm working on a new exodus level (:
Awesome! ^-^[/offtopic]
Title: Re: Pop ups in axe
Post by: DJ Omnimaga on July 01, 2010, 06:59:07 pm
glad that the issue was fixed, and Nice to hear also about the new Exodus level :)