idea for selecting things

You must understand the Game Editor concepts, before post here.

idea for selecting things

Postby Superbeni » Wed Feb 24, 2010 7:24 pm

I had an idea, but I don´t know if this is possible: Drawing a square and scale it to the cursor, if the mouse button is released, it´s easy to check the selected things with collision.
Would this work in a way like this? :?:

(I would also like to know how to scale, could somone make a little demo? :mrgreen: )
User avatar
Superbeni
 
Posts: 130
Joined: Sun Aug 02, 2009 1:23 pm
Location: Vienna, Austria
Score: 31 Give a positive score

Re: idea for selecting things

Postby Hblade » Wed Feb 24, 2010 8:16 pm

It might, give it a shot :D
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: idea for selecting things

Postby 4erv' » Thu Feb 25, 2010 10:30 am

Look here. Maybe it is what you need :D
Gold Basketball 2008 - the first basketball game made with game editor.

User avatar
4erv'
 
Posts: 188
Joined: Sat Jul 07, 2007 10:52 am
Location: in Recycle Bin
Score: 10 Give a positive score

Re: idea for selecting things

Postby thunderios » Thu Feb 25, 2010 11:22 am

I thought collisions take a lot of memory. Instead, I would have used the coordinates of what you want to select to see if it's within the box.
thunderios
 
Posts: 87
Joined: Thu Jan 31, 2008 1:18 pm
Score: 1 Give a positive score

Re: idea for selecting things

Postby DST » Thu Feb 25, 2010 9:55 pm

Background>MouseButtonDown>Left>
Code: Select all
    draw=1;       
    xprev=xmouse;
    yprev=ymouse;


Canvas>Draw Actor>
Code: Select all
    erase(255,255,255,1);
    if(draw==1){
    setpen(0, 100, 255, 0, 1);
    moveto(xmouse, ymouse);
    lineto(xprev, ymouse);
    lineto(xprev, yprev);
    lineto(xmouse, yprev);
    lineto(xmouse, ymouse);
           }


Background>MouseButtonUp>left>
Code: Select all
    if(draw==1){
    CreateTimer("unit", "1", 100);
    draw=0;
    }


Unit>Timer>1>
Code: Select all
    if(x<max(xprev, xmouse) && x>min(xprev, xmouse) && y<max(yprev, ymouse) && y>min(yprev, ymouse)){
    selected=1;
    }
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: idea for selecting things

Postby Bee-Ant » Fri Feb 26, 2010 1:11 pm

DST, Isn't this supposed to select multiple object inside the square ???
Attachments
SelectObject.zip
(2.62 KiB) Downloaded 105 times
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest

cron