Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: Munchor on October 31, 2010, 02:39:55 pm

Title: TI-BASIC Images
Post by: Munchor on October 31, 2010, 02:39:55 pm
Hello Everyone, some of you have made games in Axe and Asm that use images, sprites, maps, etc.

However, I don't program those. I program TI Basic. Is there anyway to make a sprite in the computer and convert it to TI Basic code, so, make images in TI BASIC?

Thanks much, David
Title: Re: TI-BASIC Images
Post by: JosJuice on October 31, 2010, 02:42:41 pm
You can do it using Pt-On( and/or Line(, but it's very slow. If you want something faster, you need to use ASCII characters (or a Pic variable, but they're 767 bytes and fill the whole screen).
Title: Re: TI-BASIC Images
Post by: nemo on October 31, 2010, 02:44:02 pm
something i made (http://ourl.ca/6819/112328) could be of help. though it's still rather slow.
Title: Re: TI-BASIC Images
Post by: FinaleTI on October 31, 2010, 02:45:19 pm
You can do it using Pt-On( and/or Line(, but it's very slow. If you want something faster, you need to use ASCII characters (or a Pic variable, but they're 767 bytes and fill the whole screen).
You could also go the hybrid BASIC approach, but until you're very comfortable and pretty good with pure BASIC, I wouldn't recommend it.
Title: Re: TI-BASIC Images
Post by: meishe91 on October 31, 2010, 08:23:24 pm
Ya, I think everyone kinda covered it. The main way probably is to just use the picture variables though, as JosJuice said, they are 767 bytes each and you can't do a whole lot with them unless you constantly store and restore to them since they take up the "whole" screen (I said "whole" because the screen is technically 96*64 pixels but since it's TI-BASIC it only uses the 95*63 pixels). The other way of doing pictures/images/sprites is to hard code or "hard code" them in using the drawing commands (Line(, Pxl-On(, Pt-Off(, etc.). Then there are ways of making sprites by using Text Sprites, which is clever way of using the Text( command, and there are also Dual Layers too, which is using both the Text( and picture variables cleverly to achieve good graphics (there are topics on both of these around Omnimaga). Then, technically, as nemo said you can use hexadecimal code to make sprites and such but in TI-BASIC, at least Pure TI-BASIC, it is quite slow. I have created a sprite editor that lets you create a sprite/image and then export it into hexadecimal code and nemo has that program that converts it back. Finally, if you're experienced enough to use Hybrid TI-BASIC, you can get much faster sprites and such using those and all, though I don't know much about those so I can't help much. Hope this helps.
Title: Re: TI-BASIC Images
Post by: nemo on October 31, 2010, 08:32:35 pm
the one thing meishe didn't mention are plot sprites (http://tibasicdev.wikidot.com/graphics#toc2).
Title: Re: TI-BASIC Images
Post by: meishe91 on October 31, 2010, 09:17:40 pm
Oh ya, I forgot about those. I've never used them nor ever, knowingly, seen them really used so that's why I forgot.
Title: Re: TI-BASIC Images
Post by: DJ Omnimaga on November 01, 2010, 02:25:48 am
If you need a computer program to convert bitmaps you created with paint to 8xi you can use TI-Connect screen capture (if you don't have TiLP installed) or Image Studio at http://www.omnimaga.org/index.php?action=downloads;sa=view;down=236 . Image Studio erases the 96th row of pixel, though. Also, I think Source Coder 2.5 can convert images: http://www.cemetech.net/projects/basicelite/sourcecoder2.php
Title: Re: TI-BASIC Images
Post by: MRide on November 01, 2010, 10:13:20 am
It depends on what your looking for.  If you want to do maps, dual layer (Serenity style or not) is a great way to go.
Otherwise, if your trying to draw an actual pictures, lines are the only way to go (unless, of course you want to use a picture file)
Title: Re: TI-BASIC Images
Post by: ztrumpet on November 01, 2010, 04:43:11 pm
Oh ya, I forgot about those. I've never used them nor ever, knowingly, seen them really used so that's why I forgot.
*cough* http://www.ticalc.org/archives/files/fileinfo/430/43045.html *cough*

I recommend using horizontal text sprites for beginning graphics.  They're easy to use and don't take a lot of time to display if you only need to update one or two. :)
Title: Re: TI-BASIC Images
Post by: meishe91 on November 01, 2010, 05:11:25 pm
Oh ya, I forgot about those. I've never used them nor ever, knowingly, seen them really used so that's why I forgot.
*cough* http://www.ticalc.org/archives/files/fileinfo/430/43045.html *cough*

I recommend using horizontal text sprites for beginning graphics.  They're easy to use and don't take a lot of time to display if you only need to update one or two. :)

Well they are the square plot token but are they actually Plot Sprites? ;)
Title: Re: TI-BASIC Images
Post by: ztrumpet on November 01, 2010, 05:27:20 pm
Oh ya, I forgot about those. I've never used them nor ever, knowingly, seen them really used so that's why I forgot.
*cough* http://www.ticalc.org/archives/files/fileinfo/430/43045.html *cough*

I recommend using horizontal text sprites for beginning graphics.  They're easy to use and don't take a lot of time to display if you only need to update one or two. :)

Well they are the square plot token but are they actually Plot Sprites? ;)
Yup.  * ZTrumpet points to the speed, size, and code. ;)
Title: Re: TI-BASIC Images
Post by: meishe91 on November 01, 2010, 05:55:11 pm
Oh, well I did not know that :P My apologies.
Title: Re: TI-BASIC Images
Post by: DJ Omnimaga on November 01, 2010, 10:04:22 pm
I kinda found dual layer easier, personally. I guess it migth be because of the speed, though.
Title: Re: TI-BASIC Images
Post by: gangsterveggies on November 09, 2010, 03:36:34 pm
Didn't know about those plot graphics... pretty cool. Scout... if you want graphics and stuff like that you should use AXE or ASM. I know you do so... I know you want to have a good time during physics class... there are other things :)
Title: Re: TI-BASIC Images
Post by: meishe91 on November 09, 2010, 09:16:15 pm
Didn't know about those plot graphics... pretty cool. Scout... if you want graphics and stuff like that you should use AXE or ASM. I know you do so... I know you want to have a good time during physics class... there are other things :)

Good graphics are not restricted to only Axe or Assembly, by any means. There are many pure TI-BASIC games that have great graphics, such as Exodus by Ztrumpet or Donut Quest II by DarkerLine. Also there is Hybrid TI-BASIC where you can use xLib to get great graphics, such as Shift by Builderboy.
Title: Re: TI-BASIC Images
Post by: MRide on November 09, 2010, 09:19:02 pm
Yeah, but there is always a speed sacrifice.  Still, you are right, meishe, just because a program is BASIC doesn't mean it can't have good graphics.
Title: Re: TI-BASIC Images
Post by: ztrumpet on November 09, 2010, 10:14:54 pm
I hear that Basic+Graphics+Speed is impossible.  Then I glance at these topics...
http://ourl.ca/6869
http://ourl.ca/6317
Title: Re: TI-BASIC Images
Post by: DJ Omnimaga on November 10, 2010, 02:33:59 am
Surely you will never get the speed of ASM/Axe with BASIC/xLIB, but as Ztrumpet and Meishe91 said, you can still get good speed from them.