home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


How would i create a custom loading screen?

by cubeunkown on 05/28/2008 15:21, 17 messages, last message: 05/30/2008 10:08, 1606 views, last view: 04/29/2024 14:20

I want the background to be a flyover of a sauer map and the sauer logo in the corner and the loading bar at the bottom. Is this possible?

   Board Index   

#1: HELLLO PEOPLE!

by cubeunkown on 05/28/2008 17:32

Does anyone Know? I know i would have to edit the source...

reply to this message

#2: ...

by Osbios on 05/28/2008 19:36

If you ask questions like that just forget about it! Don't even touch the source!! Go 10 feet away from your computer at all time!!! From all computers!!!!

To be serious for a moment (what is not so easy in this case) you may think about your question again.

I'm sure its not so hard to implement this feature for somebody who knows the source. But its not possible for somebody who don't even try to read the source.
Or did you read the source and don't make progress at some point? Then there may some help around here.

reply to this message

#3: ..

by cubeunkown on 05/28/2008 20:10

I did read through the source but i cant seem to find the part where the loding screen is generated.

reply to this message

#4: Re: ..

by SheeEttin on 05/28/2008 21:18, refers to #3

Work backward.
Take what you see, and try and find that in the source.
Example: The logo image. Find where it's referenced in the source.

reply to this message

#5: idea...

by tman_elite on 05/28/2008 21:30

For a fly-by of a map, you could have a series of invisible "platform" entities all moving the same speed and direction, thus making a "box" for the player. Not sure how to do this in the loading screen, but you could edit the part of the source that determines initial game mode and map to make it sp (so the platforms will work) on your fly-by map. Or you could find a way to stop player movement, then you would only need one platform. I think you could turn on 2d-gui and I think there might be a command in CVS that makes the menu load automatically on start.

reply to this message

#6: Logo Image

by cubeunkown on 05/29/2008 10:14

I found out where the logo image is and changed the background colour of the loading screen to black and i moved the logo but now the lgoo has disappered:

CODE:

int x = (w-1024)/2, y = 128;
settexture("data/sauer_logo_512_256a.png");
glBegin(GL_QUADS);
glTexCoord2f(0, 1); glVertex2i(x, y);
glTexCoord2f(0, 2); glVertex2i(x+512, y);
glTexCoord2f(0, 3); glVertex2i(x+512, y+256);
glTexCoord2f(0, 4); glVertex2i(x, y+256);
glEnd();
SDL_GL_SwapBuffers();

reply to this message

#7: ..

by cubeunkown on 05/29/2008 12:04

Uh, as this got anything to do with it?

int x = (w- 1024)/2, y = 128; ? shouldint it be

int x = (w- 512)/2, y = 256; ?

reply to this message

#8: Re: ..

by a~baby~rabbit on 05/29/2008 19:05, refers to #7

It looks like you need to learn a bit more about OpenGL - there are plenty of tutorials and books out there on the web... e.g. http://www.glprogramming.com/red/

reply to this message

#9: ..

by cubeunkown on 05/29/2008 19:17

I know i would need to move the logo as all i want is a background now. I have changed the background colour to black using glClearColour(blah) but i have lost my image by moving the cords could anyone help me with this?

reply to this message

#10: Re: ..

by Quin on 05/29/2008 20:55, refers to #9

I concur with #8, you obviously have little to no experience with OpenGL.

Unfortunately, it would take too long to walk you through it, and many of us are too busy or preoccupied with our own stuff to do so. We're a smallish community with an even smaller amount of coders, so really, we're not equipped to handle this kind of thing.

I'd suggest http://www.gamedev.net/ for tutorials, etc. Failing that, I suppose you could pay (or bribe/barter) someone to teach you/walk you through it/write it for you.

reply to this message

#11: ..

by cubeunkown on 05/29/2008 21:20

ok, thanks for your answers anyway but i might have someone who can help me

reply to this message

#12: ..

by scasd on 05/29/2008 21:49

Would it be possible to restore the old file and take its coords ?

Did you try to change coordinates only by 0.5 or 1.0 units ?

reply to this message

#13: ..

by cubeunkown on 05/29/2008 21:53

uh i changed them all to 0 thinking it would be in top left.

reply to this message

#14: ..

by cubeunkown on 05/29/2008 23:14

Right, i managed to get the cords back, and move it but the image is too stretched. and its in the middle again. here is the snippet:

int x = (w-512)/2, y = 124;
settexture("data/sauer_logo_512_256a.png");
glBegin(GL_QUADS);
glTexCoord2f(0, 0); glVertex2i(x, y);
glTexCoord2f(1, 0); glVertex2i(x+512, y);
glTexCoord2f(1, 1); glVertex2i(x+512, y+256);
glTexCoord2f(0, 1); glVertex2i(x, y+256);
glEnd();
SDL_GL_SwapBuffers();

reply to this message

#15: Re: ..

by SheeEttin on 05/29/2008 23:51, refers to #14

The texture is being drawn by picking four points on the screen and putting the texture in the square formed by those points.
If you don't keep the aspect ratio (width divided by height) the same, you'll stretch the image.
To move it and keep the aspect ratio, just set the top-left point to (0,0) and the rest of the points 0+width and/org 0+height as necessary.

Note that on a computer screen, the top-left corner is (0,0) and x and y increase as you move toward the bottom-right.

reply to this message

#16: *sigh*

by Quin on 05/30/2008 03:54, refers to #9

Okay, here. Both these articles provide a pretty concise explanation of drawing textures..

http://www.gamedev.net/reference/articles/article947.asp
http://www.gamasutra.com/features/19990723/opengl_texture_objects_01.htm

reply to this message

#17: ..

by cubeunkown on 05/30/2008 10:08

Thanks for your help but i think i have got it now. :o

reply to this message

   Board Index   


Unvalidated accounts can only reply to the 'Permanent Threads' section!


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
53869232 visitors requested 71644427 pages
page created in 0.019 seconds using 10 queries
hosted by Boost Digital