Click here to Skip to main content
15,891,597 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 Title

2d 

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. ...
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...
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.
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.
17 May 2020 by User 14475602
I have made a puzzle in 2d scene and now I want to put it in complete 3d scene. Is that even possible? How can I do that? In 3d scene, I want to put it where is visible and the player can access it with key on keyboard or somehow like that. Put...
10 May 2017 by Raghavendra Hosad
2D DFT for Color Image - GUI implementation
20 Jun 2016 by The Zakies
we will build an outline line around the drawn lines so we would test the mouse click on this outline to know which line is selected. and we would in the coming update build a select function inside the move tool
24 Jun 2016 by The Zakies
in this tut we will create a technique to enable the user to control points within a drawn line, by drawing circles around points of the line , when the user clicks a circle he would control the corresponding point.
29 Jun 2016 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
3 Jul 2016 by The Zakies
we will continue the functionality of the hand tool with having a navigator panel which works as a map, we will also have a red rectangle which tells the user where he is actually viewing inside the whole form, also it can be moved to pan the form
7 Jun 2016 by The Zakies
[tut4] how to draw lines & to draw different types on end shapes like rectangle and circle using C#
20 Jun 2016 by The Zakies
Learn how to implement a tecnique of a parent form that createes and controls other forms , through the tecnique of using the tab control, also learn how to implement a menu for the tools, and how to add cutom cursor for each tool
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.
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.
10 Jul 2017 by Voevudko A. E., Ph.D.
Demonstrating ability of the L-system in R, and offering helper functions able to plot all main categories of figures typical for the 2D L-system.
25 Nov 2020 by Richard MacCutchan
Sorry, this site is not here to do your homework. If you really cannot do this the you need to discuss your problem with your teacher.
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,...
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 =>...
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
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...
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....
23 Oct 2015 by Farhad Reza
This article describes the use of GDI+ in F# to design chess game pieces.
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.
29 Jul 2017 by Debashis 10433656
How to create an ASP.NET control for image resizer and cropper keeping aspect ratio
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.
18 Jul 2017 by Santhosh1217
I drawn a path(using coordinates of selecting area) in the panel.In this I want to display the values while hovering on the panel path.How will I do this? Please Help Me ! What I have tried: points1.Add(new Point(Convert.ToInt16(x), Convert.ToInt16(y))); Pen p = new Pen(Color.Blue, 2);...
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...
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...
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...
10 Nov 2016 by Miguel Diaz Kusztrich
An application to draw Recurrence Plots and calculate recurrence quantification measures
22 Oct 2022 by Jean-Claude Lanz
2D Drawing component with Scaling, Zooming, Scrolling, Centering and Resizing capabilities
17 Nov 2022 by André Marcos (Advisor), José Cláudio Silva, Victor Lopes
Unity Engine support for Electronic 2D game development
23 Aug 2016 by HitsRathod, Sneha Palve
Easily export chart.js charts in image formats
17 Sep 2016 by Rajesh Londhe
Face alignment rotation to improve face recognization
24 Nov 2015 by Asad Bukhari
Step by Step guide for getting started with MicroStation Application Development
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
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
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.
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...
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 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,...
17 Apr 2015 by Wendell D H
I looked for ways to do it with Array.ConvertAll, but was having trouble.But this should work.This assumes you don't know the sizes of the array dimentions//Your original objectobject saMatrix = new object[3, 3] {{ 11.0, 12.0, 13.0 }, { 21.0,...
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...
15 Nov 2022 by Richard MacCutchan
It is impossible to tell you which package is better, as that depends on too many unknowns. You need to try them for yourself to see which one best fits your requirements.
4 Nov 2015 by ryanba29
I have a large number of dynamically created rectangles to display on screen. Through trial and error I now draw only the rectangles that have changed to a bitmap and the bitmap in a OnPaint event, but i still get flickering. Any suggestions on where I might be going wrong.I'm using VS 2015...
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){ ...
4 Jan 2021 by Richard MacCutchan
Most likely you are just copying references from the temp array into the main one, so as soon as you clear the temp array, the row in the main array gets cleared. You need to do deep copying of the actual data from the temp array into the main...
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...
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
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...
14 Dec 2017 by User 7407470
In this case you should not use a 2d array, but just two arrays: String[] suits = {"Spades","Diamonds","Hearts","Clubs"}; String[] cards = {"Ace", "2","3","4","5","6","7","8","9","Jack","Queen","King"}; int cardLucky = (int)(Math.random() * 13); int suitLucky = (int)(Math.random() * 4); ...
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...
14 Mar 2023 by sebjameswml
Walks you through the steps needed to draw high quality 2D graphs in your C++ programs using the header-only library morphologica
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...
10 Apr 2021 by Richard MacCutchan
Trail: 2D Graphics (The Java™ Tutorials)[^]
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.
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...
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...
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...
5 Oct 2015 by Sergey Alexandrovich Kryukov
Please see: http://stackoverflow.com/questions/1670891/how-can-i-print-a-string-to-the-console-at-specific-coordinates-in-c[^].There is no such thing as "DOS program" on Windows. It's not just wrong words; it makes it apparent that your basic knowledge on the OS you use is badly outdated.—SA
5 Oct 2015 by Stefan_Lang
You might want to check out text user interface libraries such as curses[^]. They allow much more control than system("cls").P.S.: Even though mainly used in UNIX like systems, there are Windows implementations. We still have a curses-based app here that runs on modern Windows systems.
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...
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...
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...
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...
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.
12 Mar 2024 by Perić Željko
Sorting Multi-Dimensional Arrays in C# with QuickSort Sort Extensions
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 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 Vincent Maverick Durano
READ: Programming Problems and Finding Solutions[^] PS: Adding those exclamation marks on the subject line suggests you are late with your homework, it's rude and no one is interested in that. If you want us to help you, then start doing something by yourself. Show us what you've tried and...
10 May 2015 by Frankie-C
Try to have look here[^].Unfortunately I think that will be very difficult to find palin C frameworks.. :-(
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...
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[^]
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
2 Aug 2015 by Sergey Alexandrovich Kryukov
Just to close the "issue": your code demonstrates a correct way of saving an image as JPEG with default compression parameters. The way you find the output path is ugly thought (use System.IO.Path.Combine instead), but, of the file was actually saved, it hardly created a problem.The problem...
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...
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...
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.
25 Jul 2017 by Richard MacCutchan
See The Java Tutorials[^]
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[^].
12 Nov 2018 by Arav Singhal
Calculating the mass and inertia of a body and applying forces to it
29 Jan 2018 by Arav Singhal
Representing shapes, worlds, and integrating forces and velocities in a 2D physics engine
29 Jan 2018 by Arav Singhal
The basics of spaces, transformations and bodies used in a 2D physics engine.
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 Aug 2016 by Mr. xieguigang 谢桂纲
Manhattan plot in VisualBasic, application of the cross platform VisualBasic in the data science
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...
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...
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...
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 Jun 2016 by roks nicolas
well gdi will be slower than opengl, because it s only software rendering.In my opinion... you should use SDL if you want to make your own 2d engine... but you can find actualy 2d engine already made and "just" code the game..... making a 2d engine is already a pretty dawn task...
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.
25 Apr 2021 by Richard MacCutchan
Quote: nothing because i know nothing. Then I am afraid you will need to start learning. See C Tutorial - Tutorialspoint[^].
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...
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...