Home > 2d > How to Use Images Instead Of Drawing Primitives

How to Use Images Instead Of Drawing Primitives

August 17Hits:1
Advertisement

I want to build backgammon game. I have successfully built the board using primitives such as lines, triangles and circles. I'm curious whether it's possible to draw the board using images which will make the board look much nicer. Is it possible to have images of triangle and then to put on top of it tiles? How is this achieved?

For example, let's say I have 100x80 image of a triangle and a 100x20 tile image of tile. What theoretically needs to be done in order for the tile image to be shown on top of the triangle image? (each have different colors, and the width of both is the same).

P.S I'm currently programming this in Objective C for the iOS, but I don't think it's important, as this is more of a general question.

Thanks.

Answers

The answer is that it's simply a matter of the pictures you use. It turns out that .png files have no background which means you can create layers. I created such files using Pixelmator and here is a quick tutorial on the subject: http://www.pixelmator.com/tutorials/quickly-remove-unwanted-background/

I'm developing for the iphone so if anyone is interested, I used UIImageView and added subview to the master UIImageView and it works very nicely.

Tags:tiles

Related Articles

  • Drawing primitive shapes with TikZ

    Drawing primitive shapes with TikZJune 26

    I want to draw this picture as a noob, the way I usually do (for all other images) is to painstakingly draw line by line and manually adjusting their coordinates to get the shapes I want. I have drawn several images this way and it is a soul-destroyi

  • Draw Primitives with Unity 2DOctober 28

    I would like to be able to draw primitives in unity 2d to define my game objects. I have tried the following example: using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { public Material mat; private Vector3 startV

  • How to Use Images Instead Of Drawing Primitives August 17

    I want to build backgammon game. I have successfully built the board using primitives such as lines, triangles and circles. I'm curious whether it's possible to draw the board using images which will make the board look much nicer. Is it possible to

  • Cocos2dx- Draw primitives(polygons) on UpdateNovember 6

    In my game I'm trying to draw polygons on on each step i.e. update method. I call draw() method to draw new polygon with dynamic vertices. Following is my code: void HelloWorld::draw () { glLineWidth (1); CCPoint filledVertices[] = { ccp (drawX1, dra

  • XNA - Drawing 2D Primitives (Boxes) and Understanding Matrices in Computer GraphicsNovember 20

    I have two issues which I wish to solve by creating 2D primitives in XNA. In my game, I wish to have a "debug mode" which will draw a red box around all hitboxes in the game (Red outline, transparent inside). This would allow us to see where the

  • Drawing polygons with a repeating texture on iOSDecember 9

    I want to draw a terrain for a 2d game, and this terrain is defined by some rotated rectangles and circles, I want to draw my terrain as if it was a repeating texture clipped by those forms. I already modified the cocos2d draw primitives methods to d

  • Drawing a 2D Coordinate MapAugust 14

    I'd like to draw a 2Dimensional coordinate system using C#. Unfortunately, in terms of a graphics rendering engine, XNA is out of the question since I'm running Linux. Thus, is this possible without XNA? How exactly would I go about doing this? My go

  • Should I batch up debug primitives for rendering in modern OpenGL?October 4

    I've recently started porting some old rendering demos I did to modern OpenGL. I had a debug drawing class in my old code which used immediate mode glBegin(), glEnd() etc. for rendering debug objects such as triangles, cubes and spheres etc. Original

  • where have the shape drawing functions gone in DirectX10?February 4

    such as the CreateTeapot function - http://msdn.microsoft.com/en-us/library/windows/desktop/bb172798(v=vs.85).aspx Is there an equivalent in DX10? If so, how do I use it? In DX9 you.. Declared: LPD3DXMESH meshTeapot; Initialised: D3DXCreateTeapot(dev

  • How do I draw shape distortion with a Texture2D in XNA?June 8

    Say I have a rectangular Texture2D object in XNA, and I draw it on the screen. How can I animate it so it slowly changes to a trapezoid shape, and then to a pentagon, etc. I have no idea what this technique is called, so I couldn't find anything on G

  • how to draw the same type of circle at different positions using tikz?

    how to draw the same type of circle at different positions using tikz?February 20

    \draw [fill=black] (4,6) circle (0.3cm); \draw [fill=black] (3,4.5) circle (0.3cm); How can I define a circle called user with radius 0.3cm and fill black and just specify the position every time i draw it? --------------Solutions------------- Use a

  • Can the DXF file format/AutoCAD store custom attributes for primitives?August 4

    I am currently researching ways to draw primitives associated with data attributes. Thus I came across CAD and the DXF file format, but I am no CAD user, and the documentation I found so far is confusing me in this regard. So my question is, can I ad

  • Fractured line drawing in LaTeX

    Fractured line drawing in LaTeXJanuary 5

    whenever i try and draw a slanted vector or a line in the picture environment, I get this broken line output. Does anyone know how to fix this? --------------Solutions------------- By default latex makes sloping lines by positioning lots of small cha

  • What are some ways of making a game engine centered around the idea of drawing vector lines and polygons only? January 26

    I've always loved the look of games that just use simple lines and polygons for graphics. Rez is one of my favorite games, visually. I'm a programmer and designer first and foremost, and I'm horrible at creating Actual Art, and the idea of making a g

  • 2D XNA - Draw a CircleJanuary 16

    Yo, Hi everybody Is there any Way to draw a circle? I don't want to use a Texture/sprite to draw a circle Because the Player is the Circle so the Circle Should move ... and also I'm Trying to make it so the Player/Circle's Size gets bigger and bigger

  • Java vector drawing library/tool February 5

    I plan to develop a Java application, which should visualize diagrams based on data input. It should also have basic editor options: drawing primitive shapes with mouse (rectangle, oval...), manipulating them (move, resize, group), changing propertie

  • Mimic Picture in Picture functionalityJune 4

    We are currently setting up a conference/meeting/voting system. There is a PC (Call it CompA) whose secondary display is the public display which shows information,voting results, etc. There is another PC (call it CompB) which a clerk sits at. I woul

  • windows remote desktop vs tightvnc serverJuly 29

    Is there any comparation of the bandwidth usage, it seems that vnc take much more bandwitdh, but I am not sure. Is there any way I can make vnc use less bandwidth. --------------Solutions------------- You're absolutely right in your observation that,

  • Lowest-bandwith remote desktop?May 13

    My boss was using GoToMyPC over aircard to access his computer. It seemed to be too slow for it to be usable. The Aircard offered 188 Kbps. Is there a remote desktop with lower bandwidth requirements that would be usable with this service? ----------

  • What is nux and what's it used for?December 21

    This question mentions that Unity will use nux as the toolkit. What exactly is nux? --------------Solutions------------- Nux is a OpenGL based widget toolkit and canvas used to create user interfaces, similar to GTK+. At a high level, nux is broken d

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.395 s.