Click here to Skip to main content
15,891,607 members
Everything / 2d

2d

2D

Great Reads

by Espen Harlinn
Harlinn.Windows is a collection of libraries that I have put together that serves as a big part of the runtime we use at work.
by Miguel Diaz Kusztrich
An infinite set of biological shape fractals in the complex plain
by Petrov Vladimir
Weiler-Atherton algorithm in MFC codes demo implementation
by The Zakies
we would create Hand_tool to pan through the drawing form, and we would use a custom cursor of open and closed hands

Latest Articles

by Perić Željko
Sorting Multi-Dimensional Arrays in C# with QuickSort Sort Extensions
by Espen Harlinn
Harlinn.Windows is a collection of libraries that I have put together that serves as a big part of the runtime we use at work.
by sebjameswml
Walks you through the steps needed to draw high quality 2D graphs in your C++ programs using the header-only library morphologica
by André Marcos (Advisor), José Cláudio Silva, Victor Lopes
Unity Engine support for Electronic 2D game development

All Articles

Sort by Updated

2d 

5 Jan 2017 by Andre van Dun
Graphviz graphs from dot specification
17 Nov 2022 by André Marcos (Advisor), José Cláudio Silva, Victor Lopes
This work proposes the development of a Raycast engine in JavaScript to facilitate the 3D game development.
17 Nov 2022 by André Marcos (Advisor), José Cláudio Silva, Victor Lopes
Unity Engine support for Electronic 2D game development
14 Apr 2021 by Angelo Cresta
An extension of "A control to display pie charts with highly customizable formatting" from mattsj1984 that also renders doughnut.
29 Jan 2018 by Arav Singhal
The basics of spaces, transformations and bodies used in a 2D physics engine.
29 Jan 2018 by Arav Singhal
Representing shapes, worlds, and integrating forces and velocities in a 2D physics engine
12 Nov 2018 by Arav Singhal
Calculating the mass and inertia of a body and applying forces to it
5 Oct 2015 by Are Riff
I'm learning C++, It has been two months now.After learning many aspect of the language, I want to practice to make simple program without Graphic UI.I want to make simple games like MadLibs or MasterMind.How do I go about doing that without scrolling. I've read somewhere that they...
24 Nov 2015 by Asad Bukhari
Step by Step guide for getting started with MicroStation Application Development
17 Dec 2015 by BillWoodruff
You could use Linq to create an int[],[] Array:// requiredusing System.Linq;int[],[] jaggedArray = aList.ToArray().Select(elem => elem.ToString().Select(ch => (int)Char.GetNumericValue(ch)).ToArray()).ToArray()// orint[],[] jaggedArray = aList.ToArray().Select(elem =>...
4 Nov 2015 by bling
Turn on double buffering on the form.https://msdn.microsoft.com/en-us/library/3t7htc9c%28v=vs.110%29.aspx[^]
4 Nov 2015 by bling
Your paint handler looks strange to me. private void Form1_Paint(object sender, PaintEventArgs e) { gDisplay.DrawImage(bitmap, new Point(0, 0)); }Try this:private void Form1_Paint(object sender, PaintEventArgs e){ ...
3 Oct 2017 by BouncyTarget
This is an article about making 2D sprites in Windows Forms.
17 May 2020 by Christian Graus
A 3D scene has more data so you can't take a 2D scene and automatically make it 3D. You could GUESS the depth of objects but you can't be sure. You can GUESS their thickness in different points, but you can't be sure.
25 Jul 2017 by CPallini
What's wrong with Google? Have a look, for instance, at this page: Java 2D games tutorial - programming Java games[^].
21 Feb 2017 by Cuber01
I am working on a 2D Platformer and I am tring to add mobile controlsI am trying to make it so when you touch on the joystick the player will start shooting.What I have tried:I tried to change all of the input.getAxsis with CrossPlatformInputManger.getAxsis but all it did was make me...
9 Jun 2020 by DarkJoker666
I am doing a project for a university course to create a banking app using python. This requires a login and the data to be stored in a CSV. The issue I have is to iterate through the 2D array that has data from the csv. Through my debugging the...
22 Dec 2015 by Dave Kreskowiak
You don't. You have to use two indexes. In C, you can get away with it, but VB is a lot more strict.The solution if you want to use one index is to make it a one dimensional array. You'll have to do some additional mathematical coding to access the array using two indexes and generate a...
25 Jul 2017 by Dave Kreskowiak
No, this site is not a code-for-hire service. You're looking for Freelancer.com. Get out your credit card.
5 Apr 2021 by Dave Kreskowiak
Write it out on paper, with row and column 1 in the top left corner. Write your values out for each row and each column. It should become obvious what the formula for calculating each value at each row and column should be. 10 rows and 10...
29 Jul 2017 by Debashis 10433656
How to create an ASP.NET control for image resizer and cropper keeping aspect ratio
15 Jun 2016 by deXo-fan
Hi,My friend is sitting next to me playing a game called Terraria, and while it is 2D the graphics are quite advanced.So my question is this: If I wanted to make a similar game, 2D with complicated graphics that involve shadows and light sources and translucency and so forth, would GDI...
15 Jan 2024 by Espen Harlinn
Harlinn.Windows is a collection of libraries that I have put together that serves as a big part of the runtime we use at work.
22 Jan 2020 by F-ES Sitecore
Ensure your account has access to the D;\ drive. If you are creating a project directly in the root of the D drive, or have anything that creates files in the root of the D drive then make sure it doesn't, always work in sub-folders and sometimes access to the root can be blocked. If you don't...
1 Aug 2015 by far6ad
kindly you can make a simple file and save it anywhere you want with your own extension ... and no need to change any data in filejust make an array of bytes and fill it
23 Oct 2015 by Farhad Reza
This article describes the use of GDI+ in F# to design chess game pieces.
2 Nov 2015 by Farhad Reza
We will design two interesting characters in this tip. The first one is Code Project Bob sticker and the second one is Magpie bird which is the national bird of Bangladesh.
10 May 2015 by Frankie-C
Try to have look here[^].Unfortunately I think that will be very difficult to find palin C frameworks.. :-(
7 Feb 2021 by g96b10
Win2D provides a neat API interface, but how do you render complex sprites for your game? I provide a library and editor to make this a streamlined process.
9 Apr 2018 by gintack
C++ header file to plot data in the form of x, y, z arrays and list as potential lines and graphs
6 Jan 2016 by Harley S davidson
Here is the solution to Conway's Game Of Life problem - Enjoy it , have fun ;) . Dead cells are in Red, Alive cells are in Green and Empty cells are in White. You can modify the colours as per your need.
23 Aug 2016 by HitsRathod, Sneha Palve
Easily export chart.js charts in image formats
11 Apr 2021 by honey the codewitch
A device independent graphics library for IoT devices. Part 1 of a series.
17 Apr 2021 by honey the codewitch
GFX IoT graphics library part 2 - device independent bitmaps
25 Apr 2021 by honey the codewitch
Explore the basic drawing functionality provided by the GFX IoT library
4 May 2021 by honey the codewitch
Use an ILI9341 display efficiently from an ESP32 without the Arduino framework. Load JPEGs.
6 May 2021 by honey the codewitch
Explore the inner workings of a highly capable IoT display driver for the ESP32
3 Jun 2021 by honey the codewitch
Explore techniques for drawing using GFX
18 Jun 2021 by honey the codewitch
Use GFX effectively with e-paper/e-ink displays
29 Dec 2020 by IgorRadionyuk
An iterator over parametric function, which is a well known mathematical abstraction: Parametric Function. It maps interval of real numbers[start, stop] to some values in the range of function.
9 Jan 2017 by Jack Xu, USA
This article demonstrates how to convert the WinForm version of the Microsoft chart control into a WPF and MVVM compatible chart control and how to use it to create various charts in a WPF application.
15 Nov 2022 by James Murinio
How would you make such an animation in python? The animation is about showing the concept of time division multiplexing. Each user has data to send through the shared medium. Data is combined into frames. Length of the frame is equal to number...
22 Oct 2022 by Jean-Claude Lanz
2D Drawing component with Scaling, Zooming, Scrolling, Centering and Resizing capabilities
2 May 2018 by john ztech
//initialization int validtracks[17][2] = {{1,1}, {1,3}, {1,6},{2,3},{2,6},{3,4},{3,6},{3,8}, {4,2},{4,3},{4,7},{5,3},{5,5},{6,1}, {6,3},{7,1},{7,3}}; //main code while (matchtrack == 0) { rndint = rand() % 7 + 1; for (int r = 1; r
28 May 2021 by k5054
The simple thing to do is to add a width specifier to your format string e.g scanf("%32s\n", name[i] However, if you enter a name with spaces in it e.g. "James Earl Jones", then using the %s format, scanf will read this as 3 separate words, not...
20 Sep 2016 by Kenneth C. Santiañez
In this program, the user should be the one to input the row and column of the queen on every iteration and fortunately I managed to do that. The problem is that, on every iteration of the queen, there should be a function that will check whether the row and column is safe to place or not. The...
3 Apr 2016 by leon de boer
There is nothing wrong with the code are you sure that is the exact code you have?If this is in monodevelop then I suggest you restart unity because that code is fine.The only possibility I can think of is your script file isn't called TyroneController.cs . I remember unity is very...
1 May 2016 by Majdi Sobain
2D games programming simplicity using RingAllegro Library
6 Jul 2020 by Marijan Nikic
An animated random string selection wheel class written in Java AWT
4 Jun 2017 by Member 10610621
Guys below is my Code for My PlaycontrollerScript and PlatformMover script what i am trying to achieve here is i want when my player jump on the platform that particular group of platform to go down ,basically like doodle jump ,but as i am doing something wrong here platform groups are spawning...
22 Dec 2015 by Member 11153736
Hello.An error occurs in the place to initialize the array.How Can I Use that array ?It must be a two-dimensional array of character...Thank you. _ Public Structure ST_TEST ...
22 Dec 2015 by Member 11153736
Hello.I want to access a 2D array with only one Index.This approach is made possible in "C++", I do not know how to in "VB"..Thank you..In C++>char cTestArr[2][10];strncpy(cTestArr[0],"123456789\0",10); // Data -> char array ( PASS! )CString...
10 Jan 2018 by Member 11278731
i have to ZOOM-IN & ZOOM-OUT 2D-graphics like (line, Rectangle, circle) which i have draw on winform. I am not used any picture box, panel. I crated simple program to draw circle & on button click try to zoom but it showing error "parameter is not valid" in method Drawing() @ Line-...
17 Dec 2015 by Member 11380736
c#Is it possible to convert a ArrayList to a 2D int[1,13] array ?The ArrayList is all numbers like "1111100000000", "0111110000000".And I want them to look like this:int[,] a = { { 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 1, 1, 1,...
18 Jul 2015 by Member 11846270
I have 4 balls that I am animating. But I want to animate all the 4 balls randomly within a time limit, say 1 minute. Since I want the balls to be independent of each other, I'm creating 4 storyboards (1 for each ball). But how can I call those storyboards RANDOMLY then? To be specific,...
3 Apr 2016 by Member 12432655
I am new to using C#, and i'm trying to make a basic player controller for a 2d game. Left and right movements work properly with this although there is a problem with the "Flip" function (A function i've created to flip the player sprite on the horizontal axis to face where he is moving) at...
15 Apr 2018 by Member 13151067
Iam trying to draw an ellipse that don't move in my project and i use animation in this project but using function 'myellipse' makes the animation very slow this is the code to draw ellipse What I have tried: This is the code to draw an ellipse void myEllipse(int x,int y,float StAngle,float...
14 Dec 2017 by Member 13576973
String[][] table = new String[][] { {"Spade","Diamond","Heart","Club"}, {"Ace", "2","3","4","5","6","7","8","9","Jack","Queen","King",} }; String LuckyCard; for (int r = 0; r
22 Aug 2018 by Member 13958388
SOMEONE PLEASE HELP ME SOLVE THIS?!?!?!?! SelectKRandomPointsPurposeSelectKRandomPoints generates a list of k randomly selected pixelsfrom an image. Input(s):It takes twoinputs in the following order: 1)A 3D image array from which to select points from 2)The number of points to randomly...
22 Aug 2018 by Member 13958396
This is my first time doing matlab and I've never coded before. This was a compulsory Uni paper that I have had to take. Prior to this task I've managed to complete various other tasks but this is challenging me beyond what I've learned in the last three weeks. This is what ive got down so far...
5 Apr 2021 by Member 15136972
Have a 2 dimensional non-empty array (Map) 10x10 . The array contains integers in the range 0 - 99. But I can't seem to figure out how to make it do anything other than 1-10 on each line * The first clue is in the first column of the first...
7 Apr 2021 by Member 15136972
I'm working on a project called treasure hunt game board, where we have to make a 10x10 2d array and there will be 5 treasures and 5 pirates. Whenever the player encounters a treasure, they gain 100, then if they encounter the second one, they...
18 Jul 2018 by Michael Moroz
This articles describes how to open SVG files in C++ application, work with Bezier curves and export to PDF.
10 Nov 2016 by Miguel Diaz Kusztrich
An application to draw Recurrence Plots and calculate recurrence quantification measures
27 Nov 2017 by Miguel Diaz Kusztrich
An infinite set of biological shape fractals in the complex plain
25 Aug 2016 by Mr. xieguigang 谢桂纲
Manhattan plot in VisualBasic, application of the cross platform VisualBasic in the data science
10 Apr 2021 by Myra 2021
hello i want to try draw alphabet in java 2D graphics to learn about it. but i could not know from where should i start. can anyone show me example for how it work? What I have tried: i try looking in internet but i can't find anything help me...
9 Sep 2021 by Nils Leonhardt
Hello, I'm trying to create a short 2D game where you can wait x amount of time to get for example 50 "troops". This for now works fine, but now I need a script that detects the number of troops I have (at the startpoint) and send them out, just...
22 Jan 2020 by Oleg Pruh
Hi, I'm Oleg. Today I want to build a progect in Unity 2017.4.36f1 (64-bit) and then me in the Colsole appeared Error about UnauthorizedAccessException: Access to the path "D:\" is denied. Please HELP me with that problem. More information you can see here. UnauthorizedAccessException: Access...
30 Jan 2020 by Oleg Pruh
Hi, I work in Unity 2018.4.16f1 (64-bit). Today I had to build my project in Grudle, but there is a problem. Help me as soon as possible. Please do not write much, but to understand, you can write a solution step by step. 1 exception was raised by workers: See the Console for details. ...
1 Jun 2018 by oleg63
Hi,How can I convert 2D array of C# objects(saMatrix) to 2D double array (dArray)?Thanks.Int32 iDim = 3;object saMatrix = null;- saMatrix {object[3, 3]} object {object[,]} [0, 0] 11.0 object {double} [0, 1] 12.0 object {double} [0, 2] 13.0 object {double} [1,...
10 May 2015 by OriginalGriff
The first thing to notice is that pretty much nothing (certainly nothing I know of) will allow you to code anything web-site related in C: web design is nothing like a procedural system, which C excels in.And for a game? Particularly an arcade type game, the last thing you want is any round...
22 Jan 2020 by OriginalGriff
We can't help you. We don't have access to your code, or your data, or your system: so we have no idea what kind of access you are trying to get to the root of drive D:, or even that D: exists on your computer. Probably it does exist: the error message is telling you that your application (or...
25 Apr 2021 by OriginalGriff
That's not a "first program" in C at all - it's miles from the traditional "Hello World!" app we all started with. And while we are more than willing to help those that are stuck: that doesn't mean that we are here to do it all for you! We...
5 Oct 2015 by Patrice T
For information: DOS permit GUI.What you are doing is a console application, or said otherwise char mode application.By using a library like in Solution 2, you will be able to control the position of cursor and color of what goes on screen.What you have been doing until now is called...
20 Sep 2016 by Patrice T
We do not do your HomeWork.HomeWork is not set to test your skills at begging other people to do your work, it is set to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them. Any failure of you will help your teacher spot...
14 Dec 2017 by Patrice T
Learn to indent properly your code, it show its structure and it helps reading and understanding. It also helps spoting structures mistakes. String[][] table = new String[][] { {"Spade","Diamond","Heart","Club"}, {"Ace", "2","3","4","5","6","7","8","9","Jack","Queen","King",} }; String...
15 Apr 2018 by Patrice T
Quote: but using function 'myellipse' makes the animation very slow You want to improve speed, that process is named 'optimization', the tool that help you to spot bottle necks is the profiler. Profiling (computer programming) - Wikipedia[^] Optimization is about being critical about your...
2 May 2018 by Patrice T
Quote: Why is the conditional (highlighted in the code below) detecting a match for values that are NOT defined in the initialized 2d array ....? Because in C/C++, 'NOT defined' does not exist. Because C/C++ is unchecked, you are responsible of ensuring that you always access valid positions in...
22 Aug 2018 by Patrice T
Quote: SOMEONE PLEASE HELP ME SOLVE THIS?!?!?!?! The help you want is us doing your homeWork. You show no attempt to solve the problem yourself, you have no question, you just want us to do your HomeWork. HomeWork problems are simplified versions of the kind of problems you will have to solve...
22 Aug 2018 by Patrice T
So, you show no attempt to solve the problem yourself, you have no question, you just want us to do your HomeWork. HomeWork problems are simplified versions of the kind of problems you will have to solve in real life, their purpose is learning and practicing. We do not do your HomeWork....
25 Apr 2021 by Patrice T
Quote: I did not take an introductory course or anything like that so please help. If your claim is true, the only answer is a fail, any other answer is a cheat. More or less, you are requested to win a formula 1 GP before learning to drive a...
20 Sep 2016 by PeejayAdams
You're trying to do three things at once which is never a good idea.You essentially need to know the answer to three questions:Is there a queen in the same column?Is there a queen in the same row?Is there a queen on a diagonal?The best approach is to write separate methods for...
25 Jul 2017 by PepperDepper
Could you please make a GameBoard with a 6x6 area out of tiles that is similar to a chess board Game but with a character that can move around on only the inner 5x5 area? I need this for one of my projects but im still new to programming and need help to start. So it would be awesome if you...
12 Mar 2024 by Perić Željko
Sorting Multi-Dimensional Arrays in C# with QuickSort Sort Extensions
10 May 2015 by Peter Leow
You need the right tool to do the jobs right. It is time to start learning new tools. Check this out http://blog.lessmilk.com/unity-spaceshooter-1/[^] and see if that suits you, then go further to http://unity3d.com/learn/tutorials/modules/beginner/2d[^]
25 Feb 2018 by Petrov Vladimir
Weiler-Atherton algorithm in MFC codes demo implementation
20 Oct 2017 by petter2012
Hi, I am creating a game engine for WPF. I am trying to move away from DispatcherTimer to StopWatch, to get a more constant speed of the game (as DispatcherTimer skips turns if there are too many objects in the game). I can write the code for updating the game correctly using a StopWatch (that...
20 Oct 2017 by petter2012
I found an answer working with a colleague of mine. Check here for answer: Adding an eventhandler (compositiontarget.rendering) in WPF[^]
22 Jan 2020 by phil.o
Trying to write anything at the root of a drive will be problematic on any recent Windows version; better create a directory on the D: drive and write your files in it instead.
10 May 2017 by Raghavendra Hosad
2D DFT for Color Image - GUI implementation
30 May 2021 by Rahul Dicholkar
the code is written to sort names using dynamic allocation.i need to set limit for numbers of charaters entered by the columns and need to set limit to 32.the code is working but i dont know how to set limit for columns. columns need to set...
30 May 2021 by Rahul Dicholkar
sir the above code throws an error: error: too many arguments to function ‘getchar’ 50 | getchar(c); | ^~~~~~~ In file included from class.c:1: /usr/include/stdio.h:492:12: note: declared here 492 | extern int getchar (void); also...
17 Sep 2016 by Rajesh Londhe
Face alignment rotation to improve face recognization
18 Jul 2017 by Ralf Meier
An example for this could be : using System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Diagnostics; public class myPanel : Panel { public List ClickPoints { get { return myClickPoints; } set { myClickPoints = value; } } private...
4 Nov 2015 by ratah_
The purpose of this tip is to discuss a solution for managing a raster data format using modern C++ features.
25 Jul 2017 by Richard MacCutchan
See The Java Tutorials[^]
30 Jan 2020 by Richard MacCutchan
java.lang.RuntimeException: Duplicate class com.unity3d.ads.BuildConfig found in modules classes.jar (:UnityAds:) and classes.jar (:unity-ads:) Duplicate class com.unity3d.ads.IUnityAdsListener found in modules classes.jar (:UnityAds:) and classes.jar (:unity-ads:) Duplicate class...
21 Feb 2020 by Richard MacCutchan
Then you need to do some more research. In the meantime I suggest you also take a look at Code Project Quick Answers FAQ[^] to see how to post a question.
9 Jun 2020 by Richard MacCutchan
print(accounts.read()) # this reads all the lines from your file, but you don't save the result print(Username, "1") for row in accounts: # there is nothing to read now, since it has all been read above Remove the line print(accounts.read())...