tiles

Web templating (struts tiles) - best solution to indicate current page?

I would like to indicate the currently chosen page in a shared menu component of a web page in a Struts Tiles project. I can think of some possible solutions check current URL call some Javascript to indicate possibly hooked into the tiles or struts config files and read. I'm sure this problem has been faced many times before. What...

Struts Tiles 1 - nested tiles problem

I am using Struts tiles 1 succesfully, however I have come across a problem when trying to nest tiles. I currently have a layout like so: I wish to have another template like this, for use in quite a few user pages: So I wish to extend the first layout for the user layout. In the tiles definiton I am using: <definition name=".bas...

In Struts2, how do you share your common html across all pages?

In Struts2, how do you share your common html across all pages? In Asp.net, you've got Master pages, and in Rails there are Layouts. The idea is that your common html (eg the header, menu, and styles) are all easy to maintain because they are in one place, but for the life of me i can't find the equivalent feature in Struts2. Is it cal...

Putting a servlet's reponse in a struts template's tile

Hi, I've set up my servlet to get invoked through a struts action and the result is that it writes html to the screen. However, I'm using a template system (lets say header, content, footer) and would only like to write to the content title ie. keep the header and footer. Does anybody know if this is possible? Thanks, Gearoid. ...

Tiles: setting an attribute from an inner template to the parent

Hi all, I'm using Tiles 2.1.1 + JSP + Spring MVC 3.0. I'm new to Tiles, coming from JSF + Facelets so my question may be a bit noob... I have a master page standard.jsp which inserts a "body" template and a "header" template. I'm attempting to use a pageTitle attribute in both the master page and the header template, but I'd like to de...

Scaling and cropping huge image on the iPhone

Hi All, For the last few weeks I've been tearing my hair out trying to get a tiling mechanism working on an iPhone. I need to scale and crop images of about 150mb so that they can be saved as tiles that will be requested by a scroll view, allowing the user to see the image in high resolution. The problem is that these images are really...

The ol' fitting squares into a rectangle trick

Yes I did see the questions similar to this already posted here (notably this one). But. Am i crazy, or can the size of the square also be a non-integer? For example, in a 2x3 rectangle, one solution is squares that are .2x.2 How can i create a function to find the number of possible square sizes? ...

Tile sizing algorithm

I'm making a tile game in c++. Right now when the game loads all the tiles place themselves based on: tilesize -> they are squares so this is width and height tile_count_x tile_count_y I have the following variables: desktop_width desktop_height game_window_width game_window_height tile_count_x tile_count_y Based on these valu...

Self-describing file format for gigapixel images?

In medical imaging, there appears to be two ways of storing huge gigapixel images: Use lots of JPEG images (either packed into files or individually) and cook up some bizarre index format to describe what goes where. Tack on some metadata in some other format. Use TIFF's tile and multi-image support to cleanly store the images as a sin...

Adding a object to a bitMapData

As of right now. I have 3 objects. One BitMap that acts as my canvas. And 2 bitmapDatas. One is my buffer and another is my tiles. I am creating a tiling effect for a game. I would like to take my tile:BitMapData, and turn it into a custom object. reason being is I want each tile to be interactive. So I can click on each one. Is it possi...

certain BitMapData types dont work in a beginBitmapFill() method.

Say I loaded a bitMap into a bitmapData type called tileImage. tileImage = Bitmap(loader.content).bitmapData; say I decided to add that bitmap into a sprite like below this.graphics.beginBitmapFill(tileImage ); this.graphics.drawRect(0, 0,tWidth ,tHeight ); It would of course work. But say If I decided to add tileImage into a ano...

Why does this flood-fill algorithm cause a stack overflow?

void FloodFill(int layer, int x, int y, int target, int replacement) { if (x < 0) return; if (y < 0) return; if (x >= _mapWidth) return; if (y >= _mapHeight) return; if (_mapLayers[layer, x, y] != target) return; _mapLayers[layer, x, y] = replacement; FloodFill(layer, x - 1, y, target, replacement); Flo...

h:commandLink is not being invoked

I found a problem when using the h:commandLink in a page included by Tiles, the action/actionlistener associated with the h:commandLink is simply not being invoked. Is there any solution? Note that there are no validation errors or such any other error. ...

Using Spring, mapping to root in web.xml, static resources aren't found

I'm not quite a newcomer to Spring but what I'm attempting now I've never done. Iteemed basic when I started but I've run into a problem. What I'm trying to do is map requests to the servlet root (correct terminology?). I'm at the point where URLs are mapped to correct view but all the static content - css, javascript, images - that is...

setNeedsDisplayInRect redrawing entire view when using CATiledLayer

Hi all, this is my first time posting so please excuse any lapses in stackoverflow etiquette. I haven't found any example code or any questions that address the problem I'm having, so hopefully someone can shed some light on this. I'm using Quartz and I have a CATiledLayer on which I have drawn several boxes you can click on. When y...

Map rendering : from data to image tile :Good practice/Sample codes/Tutorial

Hi folks, I'm working on a iPhone offline map project. So i would like to generate the tiles directly in the iPhone, and I need to build a fast and efficient algorithm to render the tiles. Do you know some resources for that ? (I know some frameworks exist, like mapnik, but i need something as simple as possible, and i'll implement the...

Creating a tiled world with OpenGL

Hello, I'm planning to create a tiled world with OpenGL, with slightly rotated tiles and houses and building in the world will be made of models. Can anybody suggest me what projection(Orthogonal, Perspective) should I use, and how to setup the View matrix(using OpenGL)? If you can't figure what style of world I'm planning to create, lo...

XNA C# 2D Platformer Game

Hey, I'm trying to make (figure out how to..) a 2d platformer in XNA. I know how to create a tile grid and how to perform collision detection. I perform collision detection on the 9 bounding tiles of the player, but I'd like to know if there's a better way to perform collision detection. I've read Braid doesn't use tiles but pieced i...

HTML/JS/CSS Isometric Grid with semi-transparent click-through tiles

Hi. I'm trying to create a web app/game that uses a side-on 'isometric' view and transparent tiles. I can display them ok (but not great) using a PHP formula that just sets each div (each tile) as position:absolute and set the top and left parameters. The problem is how do I catch clicks on a tile and let tiles with transparent bits clic...

2D Engine scrolling on OpenGL via hardware?

hi, I'm using OpenGL as the bottom end for a 2D tiling engine. When everything is 2D, it is simple to optimize certain issues. For example, scrolling. If I know a certain section of the screen needs to scroll off the bottom, then I can just blit over that portion. I'm evening moving more than 1 pixel at a time. Without explicit hardware...