Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - orella

Pages: [1]
1
I'm not quite sure, but maybe if you play around with the viewport you can get something similar. It's certainly not something that just works fully automatically, as you can see in the unity gif, it only starts to scale at a certain point and doesn't get any larger after a given point.

As for the pixelation, you may need to ensure that your view and sprite position 1:1 match the pixels on your screen. If they don't fully match, then OpenGL's rasterizer will interpolate partial pixel coloring.

I have managed a similar result changing the view size and using the zoom.

For the pixelation how can I ensure that my view and sprite position 1:1 math the pixels in screen?

2
You'd have to adjust the view accordingly. Not sure whether his falls into the responsibility of ImGui or if you can change that.

I have adjusted the view and this is result:



Looks better but still not the desired result. And now if the window is big the sprite is a bit pixelated:



3
Hi!
I'm creating a game engine similar to unity but just for 2D games and right now I'm trying to finish the scene view but I'm having problems when resizing.

This is how Unity scene view looks and is what I want to achieve:



And this is what I have right now:



Here is the code used. I'm using ImGui:

Quote
// Function drawing the GameObjects to RenderTexture. window = RenderTexture
bool ModuleSceneWindow::PostUpdate()
{
   window->clear(sf::Color(100, 100, 100, 255));

   for (int j = 0; j < drawableObjects.size(); j++) {
      if (drawableObjects[j]->isActive()) {
         window->draw(*drawableObjects[j]->gameObjectSprite);
      }
   }
   window->display();

   return true;
}

// Function drawing the RenderTexture as the scene view
void PanelScene::DrawPanel()
{
   if (ImGui::BeginDock(panelName.c_str(), ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse)) {
      sf::Vector2u size = ImGui::GetContentRegionAvail();
      ImGui::Image((void*)engine->sceneWindow->window->getTexture().getNativeHandle(), size, ImVec2(0, 1), ImVec2(1, 0), sf::Color::White, sf::Color::Transparent);
   }
}

As you see, the sprite is stretching with the screen.

Any idea to know how to do it?

I know scene in Unity is 3D but uses a 2D view. Should i use openGL to achieve this result? If it's the case, I'll need extra info because I don't know openGL.

If you need more info, tell  me.

Thanks.

4
General / Re: Creating standalone of specific RenderWindow
« on: April 26, 2017, 12:29:31 am »
When i say "like Unity" i mean that the way it works is similar. It have a scene where you place/create the gameObjects, you can add components to them and scripts, etc. But it's only 2D. Obviously it's far from being like Unity ;D.

The engine is made in c++ using visual studio and the scripts you can add in gameObjects will be also in c++;

5
General / Re: Creating standalone of specific RenderWindow
« on: April 25, 2017, 09:34:30 pm »
What exactly are you trying to do?

I'm creating a game engine like Unity. And in Unity (i'm sure you know it) you have an scene where you create your game placing gameObjects and when you want to build your game then just clik on Build option and an standalone is created on the project folder. And this is what i want to do on my engine.

PS: My engine scene is a RenderTexture where i draw the gameObjects sprites.

6
General / Creating standalone of specific RenderWindow
« on: April 24, 2017, 04:41:16 pm »
Hi!

Image that I have 2 RenderWindow. One with the game I'm developing and one with a button. How can I do to create a standalone (.exe file) of the game when i press that button?

Thanks

7
Graphics / Re: Changing RenderTexture color
« on: April 24, 2017, 10:34:47 am »
NVM i found how to do that XDD

8
Graphics / Changing RenderTexture color
« on: April 24, 2017, 10:23:34 am »
Is possible to change the color of a RenderTexture without changing the colors of the sprites on the texture?

RenderTexture white:



RenderTexture green:




9
General / Re: SFML + ImGui Redefinition issue
« on: March 26, 2017, 02:34:20 pm »
Well, some minutes after posting this, i solved it by removing the default value when defining. e.g in void Init(sf::RenderTarget& target, sf::Texture* fontTexture = NULL); removing the "= NULL" and same with all the definitions.

10
General / SFML + ImGui Redefinition issue
« on: March 26, 2017, 02:11:41 pm »
Hi!.

I'm implementing ImGui to my personal 2D Engine and i'm getting redifinition errors:
   
Severity        Code    Description     Project File    Line    Suppression State
Error   C2572   'ImGui::SFML::Init': redefinition of default argument: parameter 1      2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        20     
Error   C2572   'ImGui::Image': redefinition of default argument: parameter 1   2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        38     
Error   C2572   'ImGui::Image': redefinition of default argument: parameter 2   2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        39     
Error   C2572   'ImGui::Image': redefinition of default argument: parameter 1   2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        41     
Error   C2572   'ImGui::Image': redefinition of default argument: parameter 2   2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        42     
Error   C2572   'ImGui::Image': redefinition of default argument: parameter 1   2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        44     
Error   C2572   'ImGui::Image': redefinition of default argument: parameter 2   2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        45     
Error   C2572   'ImGui::Image': redefinition of default argument: parameter 1   2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        47     
Error   C2572   'ImGui::Image': redefinition of default argument: parameter 2   2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        48     
Error   C2572   'ImGui::Image': redefinition of default argument: parameter 1   2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        51     
Error   C2572   'ImGui::Image': redefinition of default argument: parameter 2   2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        52     
Error   C2572   'ImGui::Image': redefinition of default argument: parameter 1   2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        54     
Error   C2572   'ImGui::Image': redefinition of default argument: parameter 2   2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        55     
Error   C2572   'ImGui::ImageButton': redefinition of default argument: parameter 1     2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        58     
Error   C2572   'ImGui::ImageButton': redefinition of default argument: parameter 2     2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        59     
Error   C2572   'ImGui::ImageButton': redefinition of default argument: parameter 3     2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        60     
Error   C2572   'ImGui::ImageButton': redefinition of default argument: parameter 1     2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        61     
Error   C2572   'ImGui::ImageButton': redefinition of default argument: parameter 2     2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        62     
Error   C2572   'ImGui::ImageButton': redefinition of default argument: parameter 3     2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        62     
Error   C2572   'ImGui::ImageButton': redefinition of default argument: parameter 1     2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        64     
Error   C2572   'ImGui::ImageButton': redefinition of default argument: parameter 2     2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        65     
Error   C2572   'ImGui::ImageButton': redefinition of default argument: parameter 3     2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        66     
Error   C2572   'ImGui::ImageButton': redefinition of default argument: parameter 1     2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        67     
Error   C2572   'ImGui::ImageButton': redefinition of default argument: parameter 2     2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        68     
Error   C2572   'ImGui::ImageButton': redefinition of default argument: parameter 3     2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        69     
Error   C2572   'ImGui::DrawLine': redefinition of default argument: parameter 1        2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        72     
Error   C2572   'ImGui::DrawRect': redefinition of default argument: parameter 1        2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        73     
Error   C2572   'ImGui::DrawRect': redefinition of default argument: parameter 2        2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        73     
Error   C2572   'ImGui::DrawRect': redefinition of default argument: parameter 3        2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        73     
Error   C2572   'ImGui::DrawRectFilled': redefinition of default argument: parameter 1  2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        74     
Error   C2572   'ImGui::DrawRectFilled': redefinition of default argument: parameter 2  2D-Engine       c:\users\admin\documents\github\2d-engine\2d-engine\2d-engine\sfml-2.4.2\include\imgui-1.49\imgui-sfml.h        74
 

Any help?

Pages: [1]