Search Results

Search found 4208 results on 169 pages for 'grid'.

Page 5/169 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Data structure for grid with negative indeces

    - by The Secret Imbecile
    Sorry if this is an insultingly obvious concept, but it's something I haven't done before and I've been unable to find any material discussing the best way to approach it. I'm wondering what's the best data structure for holding a 2D grid of unknown size. The grid has integer coordinates (x,y), and will have negative indices in both directions. So, what is the best way to hold this grid? I'm programming in c# currently, so I can't have negative array indices. My initial thought was to have class with 4 separate arrays for (+x,+y),(+x,-y),(-x,+y), and (-x,-y). This seems to be a valid way to implement the grid, but it does seem like I'm over-engineering the solution, and array resizing will be a headache. Another idea was to keep track of the center-point of the array and set that as the topological (0,0), however I would have the issue of having to do a shift to every element of the grid when repeatedly adding to the top-left of the grid, which would be similar to grid resizing though in all likelihood more frequent. Thoughts?

    Read the article

  • WPF unwanted grid splitter behaviour

    - by SaphuA
    Hello, I have a simple grid with 3 columns (one of which contains a grid splitter). When resizing the grid and the left column reaches its minimum width, instead of doing nothing it increases the width of the right column. Could anyone help me stop this? I can't set the max width of the right column, because the grid itself also resizes. Here's some sample code that shows the problem. While resizing, move the mouse over the red area: XAML: <Grid DockPanel.Dock="Top" Height="200"> <Grid.ColumnDefinitions> <ColumnDefinition MinWidth="200" Width="*" /> <ColumnDefinition Width="3" /> <ColumnDefinition MinWidth="120" Width="240" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Rectangle Fill="Red" Grid.Row="0" Grid.Column="0" /> <DockPanel LastChildFill="True" Grid.Row="0" Grid.Column="2" > <Rectangle DockPanel.Dock="Right" Width="20" Fill="Blue" /> <Rectangle Fill="Green" /> </DockPanel> <GridSplitter Background="LightGray" Grid.Row="0" Grid.Column="1" Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /> </Grid>

    Read the article

  • Grid does not get auto size wpf

    - by Jasim Khan Afridi
    I have a Grid inside a grid. I want it to to avail maximum size irrespective of window size. Main_Grid should be max width Grid_tool_bar should be max width but infact it is not. I am unable to find the reason. Plz help me out. <Window x:Class="SocialNetworkingApp.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Background="White" WindowStyle="None" HorizontalAlignment="Stretch" WindowState="Normal" AllowsTransparency="True" WindowStartupLocation="CenterScreen"> <Border Margin="0,0,0,0" BorderBrush="Black" BorderThickness="1,1,1,1" > <Grid x:Name="Main_Grid" Background="White" Width="Auto" Height="Auto" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"> <Grid.RowDefinitions> <RowDefinition Height="30" /> <RowDefinition Height="25"/> <RowDefinition Height="50"/> <RowDefinition Height="Auto"/> <RowDefinition Height="20"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="1*"/> </Grid.ColumnDefinitions> <Grid Name="Title_Bar" Grid.Row="0" VerticalAlignment="Top" ShowGridLines="True" Grid.IsSharedSizeScope="True" MouseDown="Drag_Window" Background="#FF4FA2DA" HorizontalAlignment="Left" Width="766" Height="31"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="30"/> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="120" /> </Grid.ColumnDefinitions> </Grid> </Grid> </Border> </Window>

    Read the article

  • applying paddingRight to flex grid column not to grid header

    - by Ben
    Whenever I add paddingRight to a column in the flex grid, it adds the padding to the header as well. Is anyone familiar with how I can add paddingRight just to the column and not to the header? Below is the column code where I was specifying the padding. <mx:DataGridColumn width="60" headerText="Type" dataField="Grade" headerStyleName="headerLeft" textAlign="left" draggable="false" resizable="false" headerRenderer="GridHeaderRenderer" paddingRight="5"/>

    Read the article

  • display image in a grid using extjs

    - by Abisha
    I am new to extjs. I want to display icon images for each grid elements. can you please healp me anybody? i am getting the image path from an xml file. my code is below. here i am displaying image path. i have to replace it by displaying image. Ext.onReady(function(){ var store = new Ext.data.Store({ url: 'new_frm.xml', reader: new Ext.data.XmlReader({ record: 'message', fields: [{name: 'first'},{name: 'last'},{name: 'company'},{name: 'email'},{name: 'gender'},{name: 'form-file'},{name: 'state'},{name: 'Live'},{name: 'content'}] }) }); var grid = new Ext.grid.GridPanel({ store: store, columns: [ {header: "First Name", width: 120, dataIndex: 'first', sortable: true}, {header: "Last Name", width: 180, dataIndex: 'last', sortable: true}, {header: "Company", width: 115, dataIndex: 'company', sortable: true}, {header: "Email", width: 100, dataIndex: 'email', sortable: true}, {header: "Gender", width: 100, dataIndex: 'gender', sortable: true}, {header: "Photo", width: 100, dataIndex: 'form-file', sortable: true}, {header: "State", width: 100, dataIndex: 'state', sortable: true}, {header: "Living with", width: 100, dataIndex: 'Live', sortable: true}, {header: "Commands", width: 100, dataIndex: 'content', sortable: true} ], renderTo:'example-grid', height:200 }); store.load(); });

    Read the article

  • trying to make a simple grid-class, non-lvalue in assignment

    - by Tyrfing
    I'm implementing a simple C++ grid class. One Function it should support is accessed through round brackets, so that I can access the elements by writing mygrid(0,0). I overloaded the () operator and i am getting the error message: "non-lvalue in assignment". what I want to be able to do: //main cGrid<cA*> grid(5, 5); grid(0,0) = new cA(); excerpt of my implementation of the grid class: template class cGrid { private: T* data; int mWidth; int mHeight; public: cGrid(int width, int height) : mWidth(width), mHeight(height) { data = new T[width*height]; } ~cGrid() { delete data; } T operator ()(int x, int y) { if (x >= 0 && x <= mWidth) { if (y >= 0 && y <= mHeight) { return data[x + y * mWidth]; } } } const T &operator ()(int x, int y) const { if (x >= 0 && x <= mWidth) { if (y >= 0 && y <= mHeight) { return data[x + y * mWidth]; } } } The rest of the code deals with the implementation of an iterator and should not be releveant.

    Read the article

  • Find Control inside Grid Row

    - by arpan911
    i m using parent child grid and on child grid i m doing Show / hide threw java script. and child grid i bind run time with Templatecolumns like GridView NewDg = new GridView(); NewDg.ID = "dgdStoreWiseMenuStock"; TemplateField TOTAL = new TemplateField(); TOTAL.HeaderTemplate = new BusinessLogic.GridViewTemplateTextBox(ListItemType.Header, "TOTAL",e.Row.RowIndex ); TOTAL.HeaderStyle.Width = Unit.Percentage(5.00); TOTAL.ItemTemplate = new BusinessLogic.GridViewTemplateTextBox(ListItemType.Item, "TOTAL", e.Row.RowIndex); NewDg.Columns.Add(TOTAL); NewDg.DataSource = ds; NewDg.DataBind(); NewDg.Columns[1].Visible = false; NewDg.Columns[2].Visible = false; System.IO.StringWriter sw = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw); NewDg.RenderControl(htw); Now I have one TextBox inside Grid named "TOTAL" I want to Find This TextBox and wanna get its value. How can Get it ?

    Read the article

  • how to write right click event for selected row in ng-grid using angularjs

    - by user3819122
    i am using angularjs to write click event for selected row from ng-grid.but i want to write right click event for selected row from ng-grid in angularjs.below is my sample code for click event for selected row in ng-grid. Sample.html: <html> <body> <div ng-controller="tableController"> <div class="gridStyle" ng-grid="gridOptions"></div> </div> </body> </html> Sample.js: app.controller('tableController', function($scope) { $scope.myData = [{ name: "Moroni", age: 50 }, { name: "Tiancum", age: 43 }, { name: "Jacob", age: 27 }, { name: "Nephi", age: 29 }, { name: "Enos", age: 34 }]; $scope.gridOptions = { data: 'myData', enableRowSelection: true, columnDefs: [{ field: 'name', displayName: 'Name', cellTemplate: '<div ng-click="foo()" ng-bind="row.getProperty(col.field)"></div>' }, { field: 'age', displayName: 'Age', cellTemplate: '<div ng-click="foo()" ng-bind="row.getProperty(col.field)"></div>' } ] }; $scope.foo = function() { alert('select'); } }); please suggest me how to do this.

    Read the article

  • Jquery grid overlay in wordpress

    - by Anders Kitson
    I am adding this simple plugin that I have working in a static html site, and am trying to add it to a wordpress development site based off of 960 gs. The jquery code links are correct but the console gives me this error "Uncaught TypeError: Cannot call method 'addGrid' of null" I got the code from this turtorial http://www.badlydrawntoy.com/2009/04/21/960gs-grid-overlay-a-jquery-plugin/ Here is the code I am using /*<![CDATA[*/ // onload $(function() { $("body").addGrid(12, {img_path: 'img/'}); }); /*]]>*/ Here is the code for the plugin /* * @ description: Plugin to display 960.gs gridlines See http://960.gs/ * @author: badlyDrawnToy sharp / http://www.badlydrawntoy.com * @license: Creative Commons License - ShareAlike http://creativecommons.org/licenses/by-sa/3.0/ * @version: 1.0 20th April 2009 */ (function($){$.fn.addGrid=function(cols,options){var defaults={default_cols:12,z_index:999,img_path:'/images/',opacity:.6};var opts=$.extend(defaults,options);var cols=cols!=null&&(cols===12||cols===16)?cols:12;var cols=cols===opts.default_cols?'12_col':'16_col';return this.each(function(){var $el=$(this);var height=$el.height();var wrapper=$('<div id="'+opts.grid_id+'"/>').appendTo($el).css({'display':'none','position':'absolute','top':0,'z-index':(opts.z_index-1),'height':height,'opacity':opts.opacity,'width':'100%'});$('<div/>').addClass('container_12').css({'margin':'0 auto','width':'960px','height':height,'background-image':'url('+opts.img_path+cols+'.png)','background-repeat':'repeat-y'}).appendTo(wrapper);$('<div>grid on</div>').appendTo($el).css({'position':'absolute','top':0,'left':0,'z-index':opts.z_index,'background':'#222','color':'#fff','padding':'3px 6px','width':'40px','text-align':'center'}).hover(function(){$(this).css("cursor","pointer");},function(){$(this).css("cursor","default");}).toggle(function(){$(this).text("grid off");$('#'+opts.grid_id).slideDown();},function(){$(this).text("grid on");$('#'+opts.grid_id).slideUp();});});};})(jQuery);

    Read the article

  • Grid overlayed on image using javascript, need help getting grid coordinates.

    - by Alos
    Hi I am fairly new to javascript and could use some help, I am trying to overlay a grid on top of an image and then be able to have the user click on the grid and get the grid coordinate from the box that the user clicked. I have been working with the code from the following stackoverflow question: Creating a grid overlay over image. link text Here is the code that I have so far: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> </script> <script type="text/javascript"> var SetGrid = function(el, sz, nr, nc){ //get number of rows/columns according to the 'grid' size //numcols = el.getSize().x/sz; //numrows = el.getSize().y/sz; numcols = 48; numrows = 32; //create table element for injecting cols/rows var gridTable = new Element('table', { 'id' : 'gridTable', 'styles' : { 'width' : el.getSize().x, 'height' : el.getSize().y, 'top' : el.getCoordinates().top, 'left' : el.getCoordinates().left } }); //inject rows/cols into gridTable for (row = 1; row<=numrows; row++){ thisRow = new Element('tr', { 'id' : row, 'class' : 'gridRow' }); for(col = 1; col<=numcols; col++){ thisCol = new Element('td', { 'id' : col, 'class' : 'gridCol0' }); //each cell gets down/up over event... down starts dragging|up stops|over draws area if down was fired thisCol.addEvents({ 'mousedown' : function(){ dragFlag = true; startRow = this.getParent().get('id'); startCol = this.get('id'); }, 'mouseup' : function(){ dragFlag = false; }, 'mouseover' : function(){ if (dragFlag==true){ this.set('class', 'gridCol'+$$('#lvlSelect .on').get('value')); } }, 'click' : function(){ //this.set('class', 'gridCol'+$$('#lvlSelect .on').get('id').substr(3, 1) ); str = $$('#lvlSelect .on').get('id'); alert(str.substr(2, 3)); } }); thisCol.inject(thisRow, 'bottom'); }; thisRow.inject(gridTable, 'bottom'); }; gridTable.inject(el.getParent()); } //sens level selector func var SetSensitivitySelector = function(el, sz, nr, nc){ $$('#lvlSelect ul li').each(function(el){ el.addEvents({ 'click' : function(){ $$('#lvlSelect ul li').set('class', ''); this.set('class', 'on'); }, 'mouseover' : function(){ el.setStyle('cursor','pointer'); }, 'mouseout' : function(){ el.setStyle('cursor',''); } }); }); } //execute window.addEvent('load', function(){ SetGrid($('imagetomap'), 32); SetSensitivitySelector(); }); var gridSize = { x: 48, y: 32 }; var img = document.getElementById('imagetomap'); img.onclick = function(e) { if (!e) e = window.event; alert(Math.floor(e.offsetX/ gridSize.x) + ', ' + Math.floor(e.offsetY / gridSize.y)); } </script> <style> #imagetomapdiv { float:left; display: block; } #gridTable { border:1px solid red; border-collapse:collapse; position:absolute; z-index:5; } #gridTable td { opacity:0.2; filter:alpha(opacity=20); } #gridTable .gridCol0 { border:1px solid gray; background-color: none; } #gridTable .gridCol1 { border:1px solid gray; background-color: green; } #gridTable .gridCol2 { border:1px solid gray; background-color: blue; } #gridTable .gridCol3 { border:1px solid gray; background-color: yellow; } #gridTable .gridCol4 { border:1px solid gray; background-color: orange; } #gridTable .gridCol5 { border:1px solid gray; background-color: red; } #lvlSelect ul {float: left; display:block; position:relative; margin-left: 20px; padding: 10px; } #lvlSelect ul li { width:40px; text-align:center; display:block; border:1px solid black; position:relative; padding: 10px; list-style:none; opacity:0.2; filter:alpha(opacity=20); } #lvlSelect ul li.on { opacity:1; filter:alpha(opacity=100); } #lvlSelect ul #li0 { background-color: none; } #lvlSelect ul #li1 { background-color: green; } #lvlSelect ul #li2 { background-color: blue; } #lvlSelect ul #li3 { background-color: yellow; } #lvlSelect ul #li4 { background-color: orange; } #lvlSelect ul #li5 { background-color: red; } </style> </div> <div id="lvlSelect"> <ul> <li value="0" id="li0">0</li> <li value="1" id="li1">1</li> <li value="2" id="li2">2</li> <li value="3" id="li3">3</li> <li value="4" id="li4">4</li> <li value="5" id="li5" class="on">5</li> </ul> </div> In this example the grid box changes color when the image is grid box is clicked, but I would like to be able to have the coordinates of the box. Any help would be great. Thank you

    Read the article

  • ????????WebLogic Server - Enterprise Grid Messaging |WebLogic Channel|??????

    - by ???02
    WebLogic Server????????????????????????????Enterprise Grid Messaging?????????? ?? ????????????????????????????????????????????????WebLogic Server?Java EE?JMS???JMS????????????JMS???????????????????????????????????????????????????????????????????????????????11gR1???Enterprise Grid Messaging????Oracle Advanced Queuing?Oracle RAC???????????????? ?????Enterprise Grid Messaging????????????????????????? ????¦WebLogic JMS????¦JMS??¦?????????¦?????????¦?????????????????¦Advanced Queue???? ???????????????????????????http://www.oracle.com/technetwork/jp/ondemand/application-grid/wls11g-egm-201107-otn-sc-439529-ja.pdf

    Read the article

  • How to choose cell to put entity in in an uniform grid used for broad phase collision detection?

    - by nathan
    I'm trying to implement the broad phase of my collision detection algorithm. My game is an arcade game with lot of moving entities in an open space with relatively equivalent sizes. Regarding the above specifications, i decided to use an uniform grid for space partitioning. The problem i have right know is how to efficiently choose in which cells an entity should be added. ATM i'm doing something like this: for (int x = 0; x < gridSize; x++) { for (int y = 0; y < gridSize; y++) { GridCell cell = grid[x][y]; cell.clear(); //remove the previously added entities for (int i = 0; i < entities.size(); i++) { Entity e = entities.get(i); if (cell.isEntityOverlap(e)) { cell.add(e); } } } } The isEntityOverlap is a simple method i added my GridCell class. public boolean isEntityOverlap(Shape s) { return cellArea.intersects(s); } Where cellArea is a Rectangle. cellArea = new Rectangle(x, y, CollisionGrid.CELL_SIZE, CollisionGrid.CELL_SIZE); It works but it's damn slow. What would be a fast way to know all the cells an entity overlaps? Note: by "it works" i mean, the entities are contained in the good cells over the time after movements etc.

    Read the article

  • Selenium Grid with parallel testing using C#/NUnit

    - by seth
    I've got several unit tests written with NUnit that are calling selenium commands. I've got 2 win2k3 server boxes setup, one is running selenium grid hub along with 2 selenium rc's. The other box is running 5 selenium rc's. All of them are registered with the hub as running Firefox on Windows (to keep it simple). In my unit test setup method I've got it connected to the hub's hostname at port 4444. When running the tests, they only run sequentially (as expected). I've done a lot of reading on NUnit's roadmap and how they are shooting for parallel testing abilities. I've seen lots of pointers to using PNUnit in the meantime. However this seems to completely defeat the purpose of the Selenium Grid. Have any of you successfully implemented parallel testing using C#/NUnit connected to a Selenium Grid setup? If so, please elaborate. I'm at a complete loss at how this will/can work using NUnit as it exists now (I'm using version 2.9.3)

    Read the article

  • ExtJS RowEditor on Grid

    - by Ian Warner
    Hi When my users edits the Grid via RowEditor combo entries and checkboxes are annoying 1 Apple 2 Orange 3 Pear For instance with the combo above the user will select Orange then update - the Grid now instead of saying orange will display the number 2 - I would like it to show orange when a successful edit has been made. code for my combo editor : { allowBlank : false, displayField : 'team', editable : false, emptyText : 'Select Team', forceSelection : true, lazyRender : true, mode : 'remote', name : 'team', store : storeTeam, triggerAction : 'all', valueField : 'id', xtype : 'combo' } I think I read that you could send the complete row back to insert or I should listen to the update of the grid and then change the field but I need some guidance on what is best Cheers

    Read the article

  • Proper usage (best practices) of Browsable attribute in .NET for runtime grid component behavior

    - by Dan
    I understand how Browsable attribute is supposed to work. It's supposed to hide a property from showing up in a PropertyGrid in design time. It also has another effect in that it will stop a Property from showing up in components such as Grids, or specifically Infragistics WinGrid. I am not sure if it has this behaviour on regular Windows Forms grids. This works, but it doesn't sound like Browsable is being use as intended when being used for 'Run time' displaying of a property on a grid component. Any literature from Microsoft on proper use. Even though it works, I don't want to use this attribute to hide columns on a grid bound to a business object if it's not indeed the correct usage of the attribute, but rather something some grid vendors decided to use to determine property visibility on their grids.

    Read the article

  • jQuery image grid effect

    - by anon
    I have an image sitting on a page that I want to create a grid type overlay (that covers the image with a black fill) which will be partitioned into 50x50 pixels (what ever size, tbh) squares. The squares on the grid will then flip over, one at a time, in random positions revealing the image below it. The only way I can think of accomplishing this would be to create a whole bunch of grid squares and overlay them on the image with jQuery, then flip each image square individually. This, though, would be a pain in the ass. Doing this all dynamically in jQuery is what I'm hoping to accomplish. Any ideas?

    Read the article

  • Javascript Grid that can handle sections in a table

    - by user335410
    I am making an ASP.NET MVC application that lets a user design a questionnaire that other users can fill out. Now, questionnaires, rather than just having a list of questions, often have sections or subsections that could have headings and not the other columns that an ordinary row (a question) would have. I want a JS Grid that can handle sections and subsections elegantly. I tried using JQGrid, but there the options I have are limited to a "Grid as Subgrid" structure. The appearance becomes quite complex and unlike a questionnaire. Is there a Javascript Grid or a JQuery plugin that can handle this? I can write my own HTML table as long as the JS app will format the table and will add some user-friendliness to the table.

    Read the article

  • Wanting a type of grid for a pixel editor

    - by wiggles
    Hi, I am currently trying to develop a basic pixel editor application to build up my programming experience with Java. I am designing it so the user has several colour options on, they click on an option and then they can drag over the cells in the grid and they change colour (like a typical image editor, but with a sort of snap on to each grid cell) Any idea of what Java component, if any, is able to implement this type of grid in Java? I had thought of each cell being a JButton, but this seemed terribly inefficient and I don't think it would be possible to change the colour of each cell(button) with out individually clicking on each one. Any help appreciated.

    Read the article

  • Optimizing a fluid grid layout

    - by user1815176
    I recently just added a grid layout, but I can't figure out how to make my links work. The grid that I used is the 1140 one at http://cssgrid.net/. I studied the source code of that website, and tried to make my page like theirs, but when I put everything in it made mine worse, and the grid didn't even work. This is how my website is supposed to look http://spencedesign.netau.net/singaporehome.html and this is how it does http://spencedesign.netau.net/home.html And when you reduce the size, it doesn't look like it's supposed to. When you minimize it I want the pictures(links) to be two per row, then one per row depending on how small the page is. I also want the quote to turn into different rows when it is too small for it. But I can't figure out how to make the page look normal regularly let alone make it look good with a smaller browser. Thanks!

    Read the article

  • Grid computing projects similar to NGrid (thread based)

    - by DivdeAndConquer
    Hello there, first time poster. This is a great place for reading about programming problems. I've been looking at some grid computing projects for .Net/Mono and stumbled upon NGrid. NGrid seems really appealing for grid computing because you simply pass threads to it and there is very little modification you have to make to your code. However, I see that NGrid (http://ngrid.sourceforge.net/?page=overview) is still at version 0.7 and hasn't been updated since May 2008. So, I'm wondering if there are any other grid computing projects that use a similar thread-passing architecture and if anyone has had success using NGrid.

    Read the article

  • 2D Tile Collision free movement

    - by andrepcg
    I'm coding a 3D game for a project using OpenGL and I'm trying to do tile collision on a surface. The surface plane is split into a grid of 64x64 pixels and I can simply check if the (x,y) tile is empty or not. Besides having a grid for collision, there's still free movement inside a tile. For each entity, in the end of the update function I simply increase the position by the velocity: pos.x += v.x; pos.y += v.y; I already have a collision grid created but my collide function is not great, i'm not sure how to handle it. I can check if the collision occurs but the way I handle is terrible. int leftTile = repelBox.x / grid->cellSize; int topTile = repelBox.y / grid->cellSize; int rightTile = (repelBox.x + repelBox.w) / grid->cellSize; int bottomTile = (repelBox.y + repelBox.h) / grid->cellSize; for (int y = topTile; y <= bottomTile; ++y) { for (int x = leftTile; x <= rightTile; ++x) { if (grid->getCell(x, y) == BLOCKED){ Rect colBox = grid->getCellRectXY(x, y); Rect xAxis = Rect(pos.x - 20 / 2.0f, pos.y - 20 / 4.0f, 20, 10); Rect yAxis = Rect(pos.x - 20 / 4.0f, pos.y - 20 / 2.0f, 10, 20); if (colBox.Intersects(xAxis)) v.x *= -1; if (colBox.Intersects(yAxis)) v.y *= -1; } } } If instead of reversing the direction I set it to false then when the entity tries to get away from the wall it's still intersecting the tile and gets stuck on that position. EDIT: I've worked with Flashpunk and it has a great function for movement and collision called moveBy. Are there any simplified implementations out there so I can check them out?

    Read the article

  • Magento Set Grid to Filter Automatically by Current Day using Existing Datetime Column in Grid

    - by Tegan Snyder
    In Magento I'm creating a custom module and would love to be able to filter automatically by the datetime column so that the intial grid listing shows only entities related to "todays" date. Here is my datetime column: $this->addColumn('ts', array( 'header' => $hlp->__('Activated'), 'align' => 'left', 'index' => 'ts', 'type' => 'datetime', 'width' => '160px', )); I'm think there should be a way for me to just add a filter to the collection like so: $now = Mage::getModel('core/date')->timestamp(time()); $dateTime = date('m/d/y h:i:s', $now); $collection = Mage::getModel('mymodule/items')->getCollection() ->addFieldToFilter('ts', $dateTime); But this doesn't work? Am I using the wrong filter? My "ts" field in the database is a "datetime" field, but the default magento "From: " - "To:" date range selectors don't use hours, minutes, seconds. Any ideas? Thanks, Tegan

    Read the article

  • Sort Grid Columns of mixed type in EXTJS Grid

    - by Amit
    Hello, I want to sort the extjs columns, I have the column type as float and from the server side i am getting values which can contain "-" value , now what happens the grid is displaying me the NaN value instead of - and the sort is not working anymore. My requirement is to create a custom sort which can sort first based on number and then sort based on string. Thanks to suggest as renderer also not works for me. My Json String is: {metaData:{"totalProperty":"total", "root":"records","fields":[{"header":"Part Number##false","name":"XJE010^VT-007!0","type":"string"},{"header":"Marketing Status##false","name":"STP716^VT-007!0","type":"string"},{"header":"Package##false","name":"XJE016^VT-007!0","type":"string"},{"header":"Automotive Grade##false","name":"STP472^VT-007!0","type":"string"},{"header":"VDSS##false","name":"XJG810^VT-007!0","type":"float"},{"header":"Drain Current (Dc)(I_D) % (A)##false","name":"XJG273^VT-006!0","type":"float"},{"header":"RDS(on) (@VGS=10V) % (&#937;)##false","name":"XJG640^VT-006!3","type":"float"},{"header":"Features##false","name":"GNP023^VT-007!0","type":"string"},{"header":"RDS(on) (@4.5 or 5V) % (&#937;)##false","name":"XJG640^VT-006!6","type":"float"},{"header":"RDS(on) (@2.7V) % (&#937;)##false","name":"XJG640^VT-006!7","type":"float"},{"header":"RDS(on) (@1.8V) % (&#937;)##false","name":"XJG640^VT-006!8","type":"float"},{"header":"Free Samples##false","name":"STP0881^VT-007!0","type":"string"},{"header":"Total Gate Charge(Qg) typ ()##true","name":"STP049^VT-002!0","type":"float"},{"header":"Total Power Dissipation(PD) % (W)##true","name":"XJG820^VT-006!0","type":"float"}]},"success":"true", "total":13,"records":[{"XJE010^VT-007!0":"STB80PF55$$/cn/analog/product/67164.jsp","STP716^VT-007!0":"Active","XJE016^VT-007!0":"D2PAK","STP472^VT-007!0":"_","XJG810^VT-007!0":"-55","XJG273^VT-006!0":"80","XJG640^VT-006!3":".018","GNP023^VT-007!0":"-","XJG640^VT-006!6":"-","XJG640^VT-006!7":"-","XJG640^VT-006!8":"-","STP0881^VT-007!0":"No","STP049^VT-002!0":"190","XJG820^VT-006!0":"300"},{"XJE010^VT-007!0":"STD10PF06$$/cn/analog/product/64543.jsp","STP716^VT-007!0":"Active","XJE016^VT-007!0":"IPAK TO-251 TO 252 DPAK","STP472^VT-007!0":"_","XJG810^VT-007!0":"-60","XJG273^VT-006!0":"-10","XJG640^VT-006!3":".2","GNP023^VT-007!0":"-","XJG640^VT-006!6":"-","XJG640^VT-006!7":"-","XJG640^VT-006!8":"-","STP0881^VT-007!0":"No ... Regards, Amit

    Read the article

  • Can i place a image as a map and then code a grid over the top of it?

    - by kraze
    what i'm trying to do is make a huge map, best way i found is just make a big map and save it as a image... can i code a grid over the top so i can implement tile based movement for my character? afterwards place collision tiles so they can't move to certain spots. btw this is in visual studio 2010 using XNA Anyone able to explain the process of how i would do this and if its even viable? thanks for your help

    Read the article

  • Telerik MVC: Telerik Menu Drops down Under Telerik Grid

    - by Ben
    I have just added a Telerik menu to my MVC application. I also have many views that render Telerik grids on them. Problem: My menu has one item with sub items. When I hover over that menu item, the dropdown slides beneath the Telerik Grid, which hides most of the sub items and makes it impossible to click them. Any idea how to make the menu dropdown slide over the grid instead of under it?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >