Search Results

Search found 11001 results on 441 pages for 'native drag drop'.

Page 8/441 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Google I/O 2010 - Programming the web with Native Code

    Google I/O 2010 - Programming the web with Native Code Google I/O 2010 - Beyond JavaScript: Programming the web with Native Code Chrome 201 Dave Springer, Ian Lewis Although JavaScript performance is rapidly increasing, there are still applications for which native code is a better choice. Learn about Native Client and how you can use it to build rich applications with all of the advantages and power of the web. For all I/O 2010 sessions, please go to code.google.com From: GoogleDevelopers Views: 10 0 ratings Time: 46:48 More in Science & Technology

    Read the article

  • Treeview drag and drop

    - by David Thorisson
    I'm using the jQuery droppable/dragable to reorder a treeview (made up of ul/li items) I have no problems making a element and dragging it into the tree When I define the items to be draggable, the code doesn´t work any more (the items are classed as "droppables" but the drop event won´t run) Isn't this supposed to be possible?

    Read the article

  • Firefox jQuery Drag and Drop File Upload together with PHP

    - by tonsils
    Hi, Hoping to get some assistance but I am after a jQuery/PHP means of allowing a user to drag and drop files and then via PHP, upload one or more files to a specific directory on a Linux box. I only have Firefox 3.6 as my base browser but can also move to FFox if need be. Cann use any HTML5 features as long as I'm using Firefox 3.6 Can someone possibly point me to any examples/sites where this process is demonstrated? I have had a look at http://www.plupload.com/index.php but this does not work in IE6. As mentioned, would like it to work in FFox only. Thanks.

    Read the article

  • Drop on NSTableView Behavior

    - by dave-gennel
    Hi, I have an NSTableView and I have successfully implemented both tableView:validateDrop:proposedRow:proposedDropOperation: and tableView:acceptDrop:row:dropOperation:. I don't need tableView:writeRowsWithIndexes:toPasteboard: because that's for dragging objects out of the NSTableView. Now, the problem is that I want it to behave kind of iTunes-like. In iTunes 9.x (I don't remember it for the previous versions) you have an NSTableView (the playlist) and when you drag a file over it you get this blue focus inside the NSTableView (maybe it's the NSScrollView?) and you don't have the blue horizontal line that indicates where you're going to insert an object. So basically I would like: No blue horizontal insert line between rows when hovering a file over the NSTableView. The blue focus inside the NSTableView (or NSScrollView). Any help would be greatly appreciated so thank you in advance.

    Read the article

  • iPhone drag/drop

    - by Farid
    Trying to get some basic drag/drop functionality happening for an iPhone application. My current code for trying to do this is as follows: - (void) touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event { UITouch *touch = [touches anyObject]; CGPoint location = [touch locationInView:self]; self.center = location; } This code has the result of a the touched UIView flickering while it follows the touch around. After playing around with it a bit, I also noticed that the UIView seemed to flicker from the 0,0 position on the screen to the currently touched location. Any ideas what I'm doing wrong?

    Read the article

  • 2 questions about drag and drop with Javascript

    - by David
    Hello, I'm trying to be able to drag random highlighted text or images on a random page that is not written by me, thus I cannot simply wrap the text in a div and make it draggable. Is there any way to get highlighted text or images on a random page, like say Yahoo, and drop it into a container that can recognize what was being dropped into it (like content and content-type) without it even being an explicitly declared draggable? I've been playing with jQuery, but can't figure it out. Any help would be greatly appreciated. Regards, David

    Read the article

  • Drag and drop between frames - chrome

    - by Gaurav Saxena
    I have a website http://fewbs.com. I have a shortcuts (bookmarks) section onto the left. Here I provide menus and submenus and drag and drop of shortcuts and menus. Though I have been able to do it in IE and FF but its not working for opera and chrome. In IE it works by default, in FF by using -moz-user-focus: ignore; -moz-user-select: none;. Can anyone suggest how may I be able to achieve the same in opera and chrome?

    Read the article

  • retain drop down value page posting back to itself asp.net

    - by d3020
    I have an aspx page that has... if (!IsPostBack) { PopulateBrand(); in the Page_Load. This PopulateBrand() simply populates my drop down. That works great and on post back it retains the value. The problem I'm having is that there is also a link on the page that is posting back some parameters to this page. What is happening is that when this is clicked it's falling through this !IsPostBack section and wiping out my drop down values that I had selected and repopulating it. How can I prevent this and just retain what I selected when this page is posting back to itself when the link is clicked? Thanks.

    Read the article

  • can't get rid of top and bottom drop shadows

    - by Jawad
    Why with the following code, I still can't get rid of drop shadows at the top and bottom. Although the drop shadows are "small", yet still they are there. div#inner_container { width: 960px; margin: 0px auto; background-color: rgb(255, 255, 255); box-shadow: 0 9px 0px 0px transparent, 0 -9px 0px 0px transparent, 12px 0 15px -4px rgba(255, 255, 255, 0.5), -12px 0 15px -4px rgba(255, 255, 255, 0.5); position: relative; z-index: 5000; }

    Read the article

  • Flex 3.0 Drag and Drop

    - by C-Man
    Hi all! I have encountered a problem in a Flex application. I have implemented drag and drop support from a List to a Canvas, and I DragManagers doDrag() - with.a proxy-image. In my custom DragDrop event handler, i place a new item on the Canvas. I use the event.localX/localY to position the new item. It is working ok, but the problem is that I want the "new" image to appear exactly where the proxy-image is when i release the mouse button (x/y -wise). Can I somehow get the proxys X,Y location. I thought that DragManager would have a reference to it but I can´t find it. Thanks /C

    Read the article

  • Drag & Drop using jQuery-ui

    - by Dhruva Sagar
    Hi, I am currently working on a project where I have to create a custom calendar sort of application to display and manage appointments easily. I need to be able to drag and reschedule appointments appropriately. jQuery-ui is pretty neat and I am able to achieve almost everything except that I require that no appointments (divs) may overlap. I am not able to figure out how to achieve this. If someone could guide me into the right direction for this, it would be great. Thanking you in advance for your time and patience.

    Read the article

  • Drag and drop + custom drawing in Android

    - by Rich
    I am working on something that needed custom drag-and-drop functionality, so I have been subclassing View, doing a bunch of math in response to touch events, and then rendering everything manually through code on the canvas in onDraw. Now, the more functionality I add, the more the code is growing out of control and I find myself writing a ton more code than I would expect to write in a high level environment like Android. Is this how it's done, or am I missing something? If I'm not doing anything fancy in the UI, the framework handles the majority of my interactions. Built-in controls handle the touches and drags, and my code is pretty much limited to business logic and data. Is there a way to leverage the power of some of the UI controls and things like animations while also doing some of it manually in the onDraw canvas? Is there an accepted standard of when to use one or the other (if indeed the two approaches can be mixed)?

    Read the article

  • Drag a UIView from one UIScrollView to another

    - by theDuncs
    I have two UIScrollViews on my screen and I need to be able to drag a UIView from one scrollview to the other. At the moment, I have a UILongGestureRecognizer on the UIView that I want to move, such that when the user starts dragging it, I make the view follow the touch: - (void)dragChild:(UILongPressGestureRecognizer *)longPress { [[longPress view] setCenter:[longPress locationInView:[[longPress view] superview]]]; } But when I get the boundary of the starting UIScrollView, the view disappears because it's locked into that scrollview's bounds. Is there a way to "pop" it out of the scrollview when I start dragging such that I can carry it over to the other scrollview? Also, how do I test for the "drop" location? I want to know if it's been dropped over a certain other view. Or am I going about this all the wrong way? Thanks guys

    Read the article

  • SQL Native Client 10 Performance miserable (due to server-side cursors)

    - by namezero
    we have an application that uses ODBC via CDatabase/CRecordset in MFC (VS2010). We have two backends implemented. MSSQL and MySQL. Now, when we use MSSQL (with the Native Client 10.0), retrieving records with SELECT is dramatically slow via slow links (VPN, for example). The MySQL ODBC driver does not exhibit this nasty behavior. For example: CRecordset r(&m_db); r.Open(CRecordset::snapshot, L"SELECT a.something, b.sthelse FROM TableA AS a LEFT JOIN TableB AS b ON a.ID=b.Ref"); r.MoveFirst(); while(!r.IsEOF()) { // Retrieve CString strData; crs.GetFieldValue(L"a.something", strData); crs.MoveNext(); } Now, with the MySQL driver, everything runs as it should. The query is returned, and everything is lightning fast. However, with the MSSQL Native Client, things slow down, because on every MoveNext(), the driver communicates with the server. I think it is due to server-side cursors, but I didn't find a way to disable them. I have tried using: ::SQLSetConnectAttr(m_db.m_hdbc, SQL_ATTR_ODBC_CURSORS, SQL_CUR_USE_ODBC, SQL_IS_INTEGER); But this didn't help either. There are still long-running exec's to sp_cursorfetch() et al in SQL Profiler. I have also tried a small reference project with SQLAPI and bulk fetch, but that hangs in FetchNext() for a long time, too (even if there is only one record in the resultset). This however only happens on queries with LEFT JOINS, table-valued functions, etc. Note that the query doesn't take that long - executing the same SQL via SQL Studio over the same connection returns in a reasonable time. Question1: Is is possible to somehow get the native client to "cache" all results locally use local cursors in a similar fashion as the MySQL driver seems to do it? Maybe this is the wrong approach altogether, but I'm not sure how else to do this. All we want is to retrieve all data at once from a SELECT, then never talk the server again until the next query. We don't care about recordset updates, deletes, etc or any of that nonsense. We only want to retrieve data. We take that recordset, get all the data, and delete it. Question2: Is there a more efficient way to just retrieve data in MFC with ODBC?

    Read the article

  • C# Drag and Drop Effect with Overlay/Opaque Image

    - by CallMeLaNN
    Hi, I think this would be simple question and should be asked in the pas few years but unable to google around and dont know if there is a specific keyword. In c# WinForm I want to do drag and drop but I dont want the image of DragDropEffects Move, Copy or whatever. I want to display an image with half opaque. Just like Firefox when dragging an image, you would see the image folowing the mouse pointer like a ghost :) I already Implement DoDragDrop, DragEnter and DragDrop events. I just want to customize the dragging effects with overlay image.

    Read the article

  • How do I know if a drag/drop has been cancelled in WPF

    - by Jon Mitchell
    I'm writing a user control in WPF which is based on a ListBox. One of the main pieces of functionality is the ability to reorder the list by dragging the items around. When a user drags an item I change the items Opacity to 50% and physically move the item in an ObservableCollection in my ViewModel depending on where the user wants it. On the drop event I change the Opacity back to 100%. The problem I've got is that if the user drags the item off my control and drops it somewhere else then I need to change the Opacity back to 100% and move the item back to where it was when the user started the drag. Is there an event I can handle to capture this action? If not is there any other cunning way to solve this problem?

    Read the article

  • Silverlight 4 Drag and Drop Treeview

    - by Rich
    Does anyone have an example for any of the following scenarios. Given, these are all dynamically populated trees. Not using a Heirarchal data template, but by iterating through object collections manually and appending children at the appropriate level. Treeview1 has 3 levels, but items can only be reordered within their level. So, lets say we have Drives, Folders and Files. Drives can be rearranged in an order, but not put into a Folder. When navigated down one level in a drive, the individual folders can be reordered, but not dragged between drives.. and same with files, only can be reordered, but not moved to a different folder or drive I have 2 treeviews, Treeview1 is the same as #1 above and Treeview2 is like a picklist of available items. A user can drag an item from Treeview2 to Treeview1, but it can only be placed at Treeview1's File Level. The dragged item cannot be a child of a file, or placed at the folder level, nor placed at the drive level. Also, how to handle the Above, On Top, or Below an item. I have yet to come across these examples.

    Read the article

  • Jquery Drag-Drop (Getting element being dropped into)

    - by Ryan
    I am trying to detect which cell an object is being dropped into. <table> <tr> <td class="weekday">Sun</td> <td class="weekday">Mon</td> <td class="weekday">Tue</td> <td class="weekday">Wed</td> <td class="weekday">Thu</td> <td class="weekday">Fri</td> <td class="weekday">Sat</td> </tr> <tr> <td class="droppable">&nbsp;</td> <td class="droppable">&nbsp;</td> <td class="droppable">&nbsp;</td> <td class="droppable">&nbsp;</td> <td class="droppable">&nbsp;</td> <td class="droppable">&nbsp;</td> <td class="droppable">&nbsp;</td> </tr> </table> <div class="draggable">Drag Me</div> on drop, how do i determine which day the div was dropped into. thanks for any help.

    Read the article

  • HTML5 Drag n Drop File Upload

    - by Paris
    I'm running a website, where I'd like yo upload files with Drag 'n Drop, using HTML5's File Api and FileReader API. I have successfully managed to create a new FileReader, but I don't know how to upload the file. My code (javascript) is the following : holder = document.getElementById('uploader'); holder.ondragover = function () { $("#uploader").addClass('dragover'); return false; }; holder.ondragend = function () { $("#uploader").removeClass('dragover'); return false; }; holder.ondrop = function (e) { $("#uploader").removeClass('dragover'); e.preventDefault(); var file = e.dataTransfer.files[0], reader = new FileReader(); reader.onload = function (event) { //I shoud upload the file now... }; reader.readAsDataURL(file); return false; }; I also have a form (id : upload-form) and an input file field (id : upload-input). Do you have any ideas? P.S. I use jQuery, that's why there is $("#uploader") and others..

    Read the article

  • jquery disable text box created after drag and drop

    - by user1736989
    I have two div one for tools where to drag and one for dropping in. html is <div id="popular"> <ul> <li class="dragfield" id="textfield">Text field</li> <li class="dragfield"id="textarea">Text area</li> <li class="dragfield"id="emailfield">email field</li> <li class="dragfield"id="dropdownselection">dropdown selection</li> <li class="dragfield"id="checkboxes">checkboxes</li> <li class="dragfield"id="multiplechoicecheckboxes">multiple choice checkboxes</li> </ul> </div> <div id="editable"> <p>hii</p> </div> and here is javascript for droppable $(function() { $('.dragfield').draggable(); $( "#editable" ).droppable({ drop: handletextDrop }); }); function handletextDrop( event, ui ) { var id = ui.draggable.attr("id"); if(id=="textfield") { var $Div = $('<div id="TextBoxDiv"></div>'); $Div.append('<label>Textbox</label>' + '<input type="text" name="textbox" id="textbox" value="" />'); $('#editable').append($Div); } } I want to make this textbox which is being created to remain disabled.javascript applying to id of these div e.g. #textbox etc. not working Is there any easy way in which i can include this html from some other page?

    Read the article

  • Drop down select to change a second drop down select automatically

    - by zvzej
    I have a webpage where I have a form with several areas to input text and two drop down select options countries is the first one and depending in witch country is chosen the second should display the estates for that country to choose. my page connects to my db from where it gets the countries and estates.... I have a table with the country names and one table for each country estates. so all I'm trying to do is making it change the states to choose from automatically depending witch country got selected with out summiting the form since that enters a new entry to another table in my db. I seen that using javascript is the way to go but can't get it to work in my case since I don't want to be sent to another page or summit the form. here is part of my code any help will be greatly appreciated. Thanks $paissql = "SELECT * FROM Paises_table"; $paisresult = mysql_query($paissql); ?> <script language="text/javascript"> function showMe(str) { <? $estadosql = "SELECT * FROM ".str."_table"; $estadoresult = mysql_query($estadosql); ?> } </script> <TABLE BORDER="2" CELLPADDING="2" CELLSPACING="2" ALIGN="CENTER"> <form action="<?php echo $_SERVER['PHP_SELF']?>" method=POST> <TR><th> id </th> <td><?php echo $row_to_edit['id']?></td> </TR> <TR><th>Nombre:</th><td><input type="TEXT" name=Nombre value="<?php echo $row_to_edit['Id_Nombre']?>" SIZE="100"></td></TR> </td></TR> <TR><th>Pais:</th><td> <select name=Pais onchange="showMe(this.value);" > <? while($rowp = mysql_fetch_array($paisresult)) { $pais = $rowp['Name']; ?> <option value=<?php echo $pais; ?> <?php if($row_to_edit['Pais']==$pais) { echo ' selected="true"';} ?> ><?php echo $pais; ?> </option> <? } ?> </select></td></TR> <TR><th>Estado:</th><td> <select name=Estado > <? while($rowe = mysql_fetch_array($estadoresult)) { $estado = $rowe['Estado']; ?> <option value=<?php echo $estado; ?> <?php if($row_to_edit['Estado']==$estado) { echo ' selected="true"';} ?> ><?php echo $estado; ?></option> <? } ?> <TR><th>Ciudad:</th><td><input type="TEXT" name=Ciudad value="<?php echo $row_to_edit['Ciudad']?>" SIZE="100"></td></TR> <TR><th>Website:</th><td><input type="TEXT" name=website value="<?php echo $row_to_edit['website']?>" SIZE="100"></td></TR> <TR><td> </td> <td> <input type="HIDDEN" name="id" value="<?php echo $edit_id?>"> Para agregar preciona aqui: <input type="SUBMIT" name="ACTION" value="AGREGAR"> </td> </TR> </form> </TABLE> <BR> <BR>

    Read the article

  • How to compile ocaml to native code

    - by Indra Ginanjar
    i'm really interested learning ocaml, it fast (they said it could be compiled to native code) and it's functional. So i tried to code something easy like enabling mysql event scheduler. #load "unix.cma";; #directory "+mysql";; #load "mysql.cma";; let db = Mysql.quick_connect ~user:"username" ~password:"userpassword" ~database:"databasename"();; let sql = Printf.sprintf "SET GLOBAL EVENT_SCHEDULER=1;" in (Mysql.exec db sql);; It work fine on ocaml interpreter, but when i was trying to compile it to native (i'm using ubuntu karmic), neither of these command worked ocamlopt -o mysqleventon mysqleventon.ml unix.cmxa mysql.cmxa ocamlopt -o mysqleventon mysqleventon.ml unix.cma mysql.cma i also tried ocamlc -c mysqleventon.ml unix.cma mysql.cma all of them resulting same message File "mysqleventon.ml", line 1, characters 0-1: Error: Syntax error Then i tried to remove the "# load", so the code goes like this let db = Mysql.quick_connect ~user:"username" ~password:"userpassword" ~database:"databasename"();; let sql = Printf.sprintf "SET GLOBAL EVENT_SCHEDULER=1;" in (Mysql.exec db sql);; The ocamlopt resulting message File "mysqleventon.ml", line 1, characters 9-28: Error: Unbound value Mysql.quick_connect I hope someone could tell me, where did i'm doing wrong.

    Read the article

  • Bind two images together to be dragged

    - by Ryan Beaulieu
    I'm looking for some help with a script to drag two images together at once. I currently have a script that allows me to drag thumbnail images into a collection bin to be saved later. However, some of my thumbnails have an image positioned over the top of them to represent these thumbnail images as "unknown" plants. I was wondering if someone could point me in the right direction as to how I would go about binding these two images together to be dragged. Here is my code: $(document).ready(function() { var limit = 16; var counter = 0; $("#mainBin1, #mainBin2, #mainBin3, #mainBin4, #mainBin5, #bin_One_Hd, #bin_Two_Hd, #bin_Three_Hd, #bin_Four_Hd, #bin_Five_Hd").droppable({ accept: ".selector, .plant_Unknown", drop: function(event, ui) { counter++; if (counter == limit) { $(this).droppable("disable"); } $(this).append($(ui.draggable).clone()); $("#cbOptions").show(); $(".item").draggable({ containment: "parent", grid: [72,72], }); } }); $(".selector").draggable({ helper: "clone", revert: "invalid", revertDuration: 700, opacity: 0.75, }); $(".plant_Unknown").draggable({ helper: "clone", revert: "invalid", revertDuration: 700, opacity: 0.75, }); }); Any help would be greatly appreciated. Thanks. EDIT: Website

    Read the article

  • Collision problems with drag-n-drop puzzle game.

    - by Amplify91
    I am working on an Android game similar to the Rush Hour/Traffic Jam/Blocked puzzle games. The board is a square containing rectangular pieces. Long pieces may only move horizontally, and tall pieces may only move vertically. The object is to free the red piece and move it out of the board. This game is only my second ever programming project in any language, so any tips or best practices would be appreciated along with your answer. I have a class for the game pieces called Pieces that describes how they are sized and drawn to the screen, gives them drag-and-drop functionality, and detects and handles collisions. I then have an activity class called GameView which creates my layout and creates Pieces objects to add to a RelativeLayout called Board. I have considered making Board its own class, but haven't needed to yet. Here's what my work in progress looks like: My Question: Most of this works perfectly fine except for my collision handling. It seems to be detecting collisions well but instead of pushing the pieces outside of each other when there is a collision, it frantically snaps back and forth between (what seems to be) where the piece is being dragged to and where it should be. It looks something like this: Another oddity: when the dragged piece collides with a piece to its left, the collision handling seems to work perfectly. Only piece above, below, and to the right cause problems. Here's the collision code: @Override public boolean onTouchEvent(MotionEvent event){ float eventX = event.getX(); float eventY = event.getY(); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: //check if touch is on piece if (eventX > x && eventX < (x+width) && eventY > y && eventY < (y+height)){ initialX=x; initialY=y; break; }else{ return false; } case MotionEvent.ACTION_MOVE: //determine if piece should move horizontally or vertically if(width>height){ for (Pieces piece : aPieces) { //if object equals itself in array, skip to next object if(piece==this){ continue; } //if next to another piece, //do not allow to move any further towards said piece if(eventX<x&&(x==piece.right+1)){ return false; }else if(eventX>x&&(x==piece.x-width-1)){ return false; } //move normally if no collision //if collision, do not allow to move through other piece if(collides(this,piece)==false){ x = (eventX-(width/2)); }else if(collidesLeft(this,piece)){ x = piece.right+1; break; }else if(collidesRight(this,piece)){ x = piece.x-width-1; break; } } break; }else if(height>width){ for (Pieces piece : aPieces) { if(piece==this){ continue; }else if(collides(this,piece)==false){ y = (eventY-(height/2)); }else if(collidesUp(this,piece)){ y = piece.bottom+1; break; }else if(collidesDown(this,piece)){ y = piece.y-height-1; break; } } } invalidate(); break; case MotionEvent.ACTION_UP: // end move if(this.moves()){ GameView.counter++; } initialX=x; initialY=y; break; } // parse puzzle invalidate(); return true; } This takes place during onDraw: width = sizedBitmap.getWidth(); height = sizedBitmap.getHeight(); right = x+width; bottom = y+height; My collision-test methods look like this with different math for each: private boolean collidesDown(Pieces piece1, Pieces piece2){ float x1 = piece1.x; float y1 = piece1.y; float r1 = piece1.right; float b1 = piece1.bottom; float x2 = piece2.x; float y2 = piece2.y; float r2 = piece2.right; float b2 = piece2.bottom; if((y1<y2)&&(y1<b2)&&(b1>=y2)&&(b1<b2)&&((x1>=x2&&x1<=r2)||(r1>=x2&&x1<=r2))){ return true; }else{ return false; } } private boolean collides(Pieces piece1, Pieces piece2){ if(collidesLeft(piece1,piece2)){ return true; }else if(collidesRight(piece1,piece2)){ return true; }else if(collidesUp(piece1,piece2)){ return true; }else if(collidesDown(piece1,piece2)){ return true; }else{ return false; } } As a second question, should my x,y,right,bottom,width,height variables be ints instead of floats like they are now? Also, any suggestions on how to implement things better would be greatly appreciated, even if not relevant to the question! Thanks in advance for the help and for sitting through such a long question! Update: I have gotten it working almost perfectly with the following code (this doesn't include the code for vertical pieces): @Override public boolean onTouchEvent(MotionEvent event){ float eventX = event.getX(); float eventY = event.getY(); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: //check if touch is on piece if (eventX > x && eventX < (x+width) && eventY > y && eventY < (y+height)){ initialX=x; initialY=y; break; }else{ return false; } case MotionEvent.ACTION_MOVE: //determine if piece should move horizontally or vertically if(width>height){ for (Pieces piece : aPieces) { //if object equals itself in array, skip to next object if(piece==this){ continue; } //check if there the possibility for a horizontal collision if(this.isAllignedHorizontallyWith(piece)){ //check for and handle collisions while moving left if(this.isRightOf(piece)){ if(eventX>piece.right+(width/2)){ x = (int)(eventX-(width/2)); //move normally }else{ x = piece.right+1; } } //check for and handle collisions while moving right if(this.isLeftOf(piece)){ if(eventX<piece.x-(width/2)){ x = (int)(eventX-(width/2)); }else{ x = piece.x-width-1; } } break; }else{ x = (int)(eventX-(width/2)); } The only problem with this code is that it only detects collisions between the moving piece and one other (with preference to one on the left). If there is a piece to collide with on the left and another on the right, it will only detect collisions with the one on the left. I think this is because once it finds a possible collision, it handles it without finishing looping through the array holding all the pieces. How do I get it to check for multiple possible collisions at the same time?

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >