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.

Author
Message
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 8th Feb 2014 13:32
Hello Community!

I am using blue gui. I want to make acube when i am pressing a button but the actual size of it to be taken by user that typed in two text boxes a width one and a height one. How can i achieve this?

Thank You very much for your support!

Alex Matei CEO
www.alexmatei.com
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 8th Feb 2014 14:10
You have to make your menu with two areas for each axes x,y,z then when you know the three values, you can make your object.

Make object box 1, x_value,y_value,z_value

I'm not a grumpy grandpa
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 8th Feb 2014 15:50
Hi Chafari!

I created the menu with the textboxes and when the apply button is clicked the box must be created with the user typed valuesfrom the textboxes but it didn't worked...

Alex Matei CEO
www.alexmatei.com
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 8th Feb 2014 19:06 Edited at: 8th Feb 2014 19:14
I'm not sure what you have done, but when we create a button, we have to read if the mouse is over and if we are clicking mouse. Here is a quick example I made for you. Please don't laugh with the design, was just to show you. You will have to put that into function, and you will figure out how to decrease values as in this example, you only can increase values. Every time you click in "MAKE" one box will be created, and will be positioned in random places. Notice how to stop values control. I hope this clumsy code can show you how to achieve that.




Cheers.

I'm not a grumpy grandpa
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 10th Feb 2014 11:37
Hello Chafari!

Sorry for the delay. Thank You very much! Nice code indeed!

I have to general problems all the time that i can't seem to pass them.

First one some sprites like lines and boxes to create a menu such as here in this case with this code for creating cubes, the menu doesn't show all up, just a few lines and a box.

Second, when i am incrementing some objects and finish with them placing them, when i re enter the command to make new objects lets say i forgot to put a cube somewhere, it gives me an error like "The object already exist at line blah blah" how can i pass this error to tell Dark Basic, alright i know about this please pass the error and go to the next number to apply a new cube with a new number after all the numbers that are already been occupied by other cubes.

I so appreciate your time!
Thank You very much!!!

Alex Matei CEO
www.alexmatei.com
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 10th Feb 2014 14:03
To avoid the error ...object already exist...you have to make a variable, let say Obj, and every time you create a new object, in the same condition, you put Obj=Obj+1...so when you make new object, just writte
make object box Obj,sizex,sizey,sizez

I'm not a grumpy grandpa
Sph!nx
17
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 10th Feb 2014 14:05 Edited at: 10th Feb 2014 14:05
You can check, before you use an object, if it exists.


Regards Sph!nx
www.mental-image.net
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 10th Feb 2014 14:54
This is the code. It says the same thing and the "cbe" object is assigned a certain number. If you ask why its so high, because another command has a limit from 0 to that -1 unit from cbe's number and after that certain number begins cbe to function.



Alex Matei CEO
www.alexmatei.com
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 10th Feb 2014 15:16
Quote: " `PROBLEM!!!
`Move object up and down
if keystate(201) = 1
yup# = yup# + 0.1
inc yup#
move object up cbe,yup#
endif

if keystate(209) = 1
yup# = yup# - 0.5
dec yup#
move object down cbe,yup#
endif"


I can't see your code working because this is just a function, but I've seen something weird here. If you press key(209) you increment variable yup# adding 0.1 to the value (yup#=yup#+0.1) and under this line you use inc yup#....to increment variable againg

Hadn't you better inc yup# ,0.1 or Dec yup# , -0.5

Cheers.

I'm not a grumpy grandpa
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 10th Feb 2014 15:33
Yes its a problem there and i must figure out why it doesn't go down normally. Meaning that when i am decreasing the value it goes down but suddenly it goes up when pressing the down button. Also with the object exist is there something wrong in my code? I tried your idea

Thank You!

Alex Matei CEO
www.alexmatei.com

Login to post a reply

Server time is: 2026-07-06 07:52:32
Your offset time is: 2026-07-06 07:52:32