Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Draw 3D plains, then sprites and last write text

Author
Message
Cybermind
Valued Member
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 12th Feb 2012 22:45
I am trying to make a map editor where I use sprites for GUI, like scroll bars and buttons, when I click a button I just change the text that is written there (with text 0,0,string$ command) and then I use the 3D plains as tiles for the map. But I can only have 2 of the 3 elements at the same time :-( I use draw sprites last.

Any good way to get all of them drawn at the same time? or should I go in a different direction?

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 13th Feb 2012 09:56
It would be good to see some code, otherwise we'll have to make way too many assumptions.

Use a for...next loop?

TheComet

Cybermind
Valued Member
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 13th Feb 2012 12:05
Allright, some code

This is the main code


This code places the sprites


This is code is called from the main loop and writes the text on top of the sprites


This code creates the 3D plains


The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 13th Feb 2012 14:10
tagging in

Cybermind
Valued Member
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 13th Feb 2012 18:49 Edited at: 13th Feb 2012 19:03
I am using Cloggy's D3D_Func DLL now, but it is the same :-( Sprites, 3D, and text will not show at the same time

EDIT: Does anyone know why it has to be so cumbersome to combine text, 3D and 2D? I would say it is quite normal in game production to do this

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
Cybermind
Valued Member
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 14th Feb 2012 21:50
Okay, now I am pasting my sprites to the screen in an update function, BUT is it faster to use paste sprite or paste image?

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
Cybermind
Valued Member
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 14th Feb 2012 22:06 Edited at: 14th Feb 2012 22:08
Pasting the sprites did not work, BUT IanM's Matrix1 Utility plug-ins together with Cloggys D3D_Func stuff now produces text, 3D and 2D
Actually Cloggy's is not needed now as all text appeared, also text not yet converted to Cloggy's D3D text

My main loop looks like this (it is the commands DRAW SPRITES MANUAL and DRAW SPRITES that does the trick, as I do everything I need to do before DRAW SPRITES, when DRAW SPRITES (which updates sprites manually) have been called I then do everything needed to be done after that, including SYNC (which no longer affects sprites)


EDIT: But Cloggy's should be faster for text, and I did not test PASTE IMAGE instead of PASTE SPRITE so I cannot say if that works also

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
Cybermind
Valued Member
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 14th Feb 2012 22:17
Now there are two ways to this, with either None, Cloggy or IanM's Matrix1 Utility plug-ins. This one shows Cloggys, and I do not think IanM's Matrix1 Utility is needed here. This one can be modified by just removing the Cloggy D3D commands and replacing them with DBPro native commands, but I read somewhere that Cloggy's should be faster, and also read that some had troubles with this plugin running.

I need to set DRAW SPRITES FIRST, then call my update_ui_images and lastly I update the text:






The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
Cybermind
Valued Member
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 15th Feb 2012 19:11
Anyone need the simple version? Then I will write a short guide without my own code confusing the whole thing

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...

Login to post a reply

Server time is: 2026-07-10 03:10:02
Your offset time is: 2026-07-10 03:10:02