### Author Topic: GreyScale Splash Screen  (Read 7234 times)

0 Members and 1 Guest are viewing this topic.

#### ACagliano

• Posts: 915
• Rating: +32/-2
##### GreyScale Splash Screen
« on: February 17, 2011, 10:33:04 am »
I have failed to produce a good splash screen for Zelda. I still do not understand how to utilize the greyscale in Axe. I would like a splash screen that says "Legend of Zelda", "Ganon's Rage", and potentially has an image of the triforce. I don't care how many layers of greyscale it is. I would rather it be done by someone who has succeeded in using Axe grayscale before, but if someone teaches me how to do it, that would be cool too.

#### aeTIos

• Nonbinary computing specialist
• LV12 Extreme Poster (Next: 5000)
• Posts: 3913
• Rating: +184/-32
##### Re: GreyScale Splash Screen
« Reply #1 on: February 17, 2011, 10:41:57 am »
Grayscale works by changing pixels on and off repeatly. you see this as gray.
You can do grayscale this way:
Code: [Select]
ClrDraw(radians)     >next time, i use (r)Pause 100   (to prevent the program fron shutting down immediately)Repeat getKeyClrDraw(r)Pt-On(Xpos,Ypos,[FFFFFFFFFFFFFFFFDispGraph(r)EndThis displays a grayscale square somewhere on the screen (put an X and Y position in)
You can do this for the whole image, but also for a part of it
If you want a part not being gray, simply don't put a (r) after the Pt-On

I hope that this short tutorial is useful for you.

I'm not a nerd but I pretend:

#### ACagliano

• Posts: 915
• Rating: +32/-2
##### Re: GreyScale Splash Screen
« Reply #2 on: February 17, 2011, 10:52:21 am »
Grayscale works by changing pixels on and off repeatly. you see this as gray.
You can do grayscale this way:
Code: [Select]
ClrDraw(radians)     >next time, i use (r)Pause 100   (to prevent the program fron shutting down immediately)Repeat getKeyClrDraw(r)Pt-On(Xpos,Ypos,[FFFFFFFFFFFFFFFFDispGraph(r)EndThis displays a grayscale square somewhere on the screen (put an X and Y position in)
You can do this for the whole image, but also for a part of it
If you want a part not being gray, simply don't put a (r) after the Pt-On

I hope that this short tutorial is useful for you.

It does, but the code is only showing black.

I got it working.
« Last Edit: February 17, 2011, 10:54:19 am by ACagliano »

#### ACagliano

• Posts: 915
• Rating: +32/-2
##### Re: GreyScale Splash Screen
« Reply #3 on: February 17, 2011, 10:59:47 am »
How would I make the entire back buffer black?

#### Munchor

• LV13 Extreme Addict (Next: 9001)
• Posts: 6199
• Rating: +295/-121
• Code Recycler
##### Re: GreyScale Splash Screen
« Reply #4 on: February 17, 2011, 11:13:19 am »
How would I make the entire back buffer black?

The main buffer:

Code: [Select]
Rect(0,64,96,64)

#### ACagliano

• Posts: 915
• Rating: +32/-2
##### Re: GreyScale Splash Screen
« Reply #5 on: February 17, 2011, 11:15:35 am »
Ok. And one last question. How would I draw the text I want to the back buffer, and have it remain black, as the rest is gray?

#### Munchor

• LV13 Extreme Addict (Next: 9001)
• Posts: 6199
• Rating: +295/-121
• Code Recycler
##### Re: GreyScale Splash Screen
« Reply #6 on: February 17, 2011, 11:22:53 am »
Ok. And one last question. How would I draw the text I want to the back buffer, and have it remain black, as the rest is gray?

Not sure what you mean, but maybe this...

Code: [Select]
Rect(0,64,96,64)rText(0,0,"This is some black text")DispGraphr
Note: the r after Rect() and DispGraph is accessed by 2ND+APPS+3.

If you're using Tokens to program, just do Rect(0,64,96,64)^^r.
« Last Edit: February 17, 2011, 11:23:21 am by Scout »

#### ACagliano

• Posts: 915
• Rating: +32/-2
##### Re: GreyScale Splash Screen
« Reply #7 on: February 17, 2011, 11:41:37 am »
It shows the text as grayscale too.

#### Munchor

• LV13 Extreme Addict (Next: 9001)
• Posts: 6199
• Rating: +295/-121
• Code Recycler
##### Re: GreyScale Splash Screen
« Reply #8 on: February 17, 2011, 11:56:52 am »
It shows the text as grayscale too.

Code: [Select]
Rect(0,64,96,64)rText(0,0,"This is some black text")DispGraphr
I tried this:

Code: [Select]
.IMGFix 5Repeat getKey(15)Rect(0,0,96,64)^rText(0,0,"TextDispGraph^rEndFix 4
And I got grey background and in black, 'Text' at coordinates (0,0).

#### ACagliano

• Posts: 915
• Rating: +32/-2
##### Re: GreyScale Splash Screen
« Reply #9 on: February 17, 2011, 12:15:58 pm »
Quick Grayscale Tutorial

3 level gray:
Three level grayscale is utilized by using the command DispGraphr in place of the normal DispGraph command. Three level gray uses the backbuffer (L3) and the front buffer (L6). Everything on the back buffer will show as gray while everything on the front buffer will show as black. The front buffer is drawn over the back buffer, so if a pixel is "on" on both the front and back buffers, it will be shown as black.

You can change the common drawing operations Pt-On, Pt-Off, Pt-Change, Pxl-On, ClrDraw, Rect, Line, DrawInv, etc. to operate on the back buffer by adding the raidan r at the end of the command. For example, Pt-On(X,Y,Pic1)r will draw Pic1 to the backbuffer. If you then look at it with DispGraph, you will see it in gray.

Text, by default is drawn directly to the screen and not to the buffer. For this reason, it can appear as grayscale because it is being erased every time you call DispGraphr, and then redrawn very quickly. To make it so that text is drawn to the buffer, put a Fix 5 at the beginning of the program (and a Fix 4 at the end). To draw text to the back buffer, you will have to Exch the back and front buffers, write to the front buffer, and switch back:
Code: [Select]
Exch(L3,L6,768): Text(X,Y,"Text") : Exch(L3,L6,768)
4 level gray
With four level gray, the front buffer becomes somewhat transparent. Use the following table to figure out the pixel colors:
Code: [Select]
Front:Back:Color0    :1   :Light Gray0    :0   :White1    :0   :Dark Gray1    :1   :Black
Buffer operations remain the same. To display in four level gray, use DispGraphrr

Note: In order for the grayscale to show up, you must put the DispGraphr or DispGraphrr in a loop. In monochrome, you can get away with this:
Code: [Select]
:Pt-On(X,Y,Pic1):DispGraph:Repeat getKey:EndBut with grayscale, you'll have to write the code like this:
Code: (displays Pic1 in dark gray) [Select]
:Pt-On(X,Y,Pic1):Repeat getKey:DispGraph[sup]r[/sup][sup]r[/sup]:End
edit: 1000 posts

It shows the text as grayscale too.

Code: [Select]
Rect(0,64,96,64)rText(0,0,"This is some black text")DispGraphr
I tried this:

Code: [Select]
.IMGFix 5Repeat getKey(15)Rect(0,0,96,64)^rText(0,0,"TextDispGraph^rEndFix 4
And I got grey background and in black, 'Text' at coordinates (0,0).

I had it set Fix 4 at the beginning, that is why. It works now. Thanks.
« Last Edit: June 14, 2011, 02:58:18 pm by DJ_O »

#### Munchor

• LV13 Extreme Addict (Next: 9001)
• Posts: 6199
• Rating: +295/-121
• Code Recycler
##### Re: GreyScale Splash Screen
« Reply #10 on: February 17, 2011, 01:41:33 pm »
"I had it set Fix 4 at the beginning, that is why. It works now. Thanks."

Fix 5 makes it able to have text and images in the same screen.
Fix 4 disables it, ALWAYS DISABLE IT (Fix 4) BEFORE THE PROGRAM CLOSES, ALWAYS.

Your calculator can crash I think.

#### Builderboy

• Physics Guru
• CoT Emeritus
• LV13 Extreme Addict (Next: 9001)
• Posts: 5673
• Rating: +613/-9
• Would you kindly?
##### Re: GreyScale Splash Screen
« Reply #11 on: February 17, 2011, 03:43:41 pm »
Actually the worst thing that can happen is that when you view the mode menu you don't see anything the first time Or similarly if you view the Y= menu or any other menu that uses the small font.  It's so stable that I still haven't bothered putting a Fix 4 at the end of PortalX because I'm too lazy and I know that it won't cause any issues.  That said, it is a good idea for a final release, because people might think you messed up their mode screen or whatever.

#### squidgetx

• Food.
• CoT Emeritus
• LV10 31337 u53r (Next: 2000)
• Posts: 1881
• Rating: +503/-17
• rawr.
##### Re: GreyScale Splash Screen
« Reply #12 on: February 17, 2011, 03:46:13 pm »
Same here, I never do it until I make a release. Also, it goes away as soon as your calc turns off.

#### Darl181

• «Yo buddy, you still alive?»
• CoT Emeritus
• LV12 Extreme Poster (Next: 5000)
• Posts: 3408
• Rating: +305/-13
• VGhlIEdhbWU=
##### Re: GreyScale Splash Screen
« Reply #13 on: February 17, 2011, 07:37:31 pm »
It's actually kind of interesting with the lack of a fix 4
I remember playing super mario 2.0 and everything was weird
Also, omnicalc looked interesting...
Vy'o'us pleorsdti thl'e gjaemue

#### Deep Toaster

• So much to do, so much time, so little motivation
:0→{L3}:Fill(L3,767)