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

Author Topic: Question about output  (Read 5987 times)

0 Members and 1 Guest are viewing this topic.

FlatlanD

  • Newbie
  • *
  • Posts: 8
    • View Profile
Question about output
« on: March 07, 2014, 05:11:52 pm »
Hello guys,

I need to make this thing in my program: When I press number from 1 to 9 it shows it in a current square of a table and when I press arrow key (Up,Right,Down, Left) that numbers stays in that place where it is entered and I could enter new number in a different square of  a table and then press arrow key and again that number should stay where it is entered and so on. So I want to ask you how I can do that, because I really have a problem making that.

Thanks for your help.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
AW: Question about output
« Reply #1 on: March 07, 2014, 06:01:15 pm »
With what exactly do you have a problem?
Programming logic? SFML code? A specific code piece?

F a start read the SFML tutorials on windows and event handling, as well as the general game loop. ;)

Remember we won't be code the application for you.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FlatlanD

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Question about output
« Reply #2 on: March 07, 2014, 08:18:46 pm »
I know you won't make it for me but I just want to know how to make it and what should I use. I'm having problem with that part to left number where it was entered and move to another position without moving previous entered number.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
AW: Question about output
« Reply #3 on: March 07, 2014, 09:38:37 pm »
Can you write a simple hello world application? Have managed to get a window displaying?

Whenever I hear such very general question I have to ask myself, whether the other person has any programming experience... If not, you should first learn the basic, start with a good C++ book. ;)

If you're just stuck, then tell us specifically where you're having problems. Your statements so far were way to general to give an useful answer...
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FlatlanD

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Question about output
« Reply #4 on: March 08, 2014, 09:41:20 am »
I can write a hello world app. I said you a problem, I need to make a real-time input output, and make it a different positions on a screen, with a loop, not a hundred text variables and hundred times draw them, do you understand now?!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Question about output
« Reply #5 on: March 08, 2014, 09:53:14 am »
Well I still have no idea where you're stuck, but it sounds like you're looking for some STL container, such as std::vector. Then you get one vector variable that can hold x amount of objects.
Every good C++ book will explain how to use them and you can look at a C++ reference as well. :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Cadisol87

  • Full Member
  • ***
  • Posts: 129
  • C++ Programmer
    • View Profile
Re: Question about output
« Reply #6 on: March 08, 2014, 11:28:55 am »
Okay, currently I also don't have an idea where exactly you are stuck at.

I think you might wanna do something like that (yeah, I know my paint skills are awesome ;) ):


With the blue square you can select a field and enter a number. You can move the blue square with the arrow keys.
Is that what you want to achieve?

FlatlanD

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Question about output
« Reply #7 on: March 08, 2014, 10:08:13 pm »
Okay, currently I also don't have an idea where exactly you are stuck at.

I think you might wanna do something like that (yeah, I know my paint skills are awesome ;) ):


With the blue square you can select a field and enter a number. You can move the blue square with the arrow keys.
Is that what you want to achieve?

Yes, this is what I meant. So how I can do that? What should I use?

Cadisol87

  • Full Member
  • ***
  • Posts: 129
  • C++ Programmer
    • View Profile
Re: Question about output
« Reply #8 on: March 09, 2014, 02:57:02 pm »
What do you mean with 'what should I use' ?

You have to ask more precisely.

For example, you could ask:
Should I use a image as background or should I create it with rectangle shapes?
Or
Should I use vectors to store the rectangle shapes or should I create them separately?

But if you only ask 'what should I use' I (and probably the others) won't be able to help you, because we don't exactly know were you're stuck at.


FlatlanD

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Question about output
« Reply #9 on: March 09, 2014, 04:54:48 pm »
I don't ask about how to create a table, square or something else, like I ahve written before, I'm asking how to make a real-time input output, read above ^

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Question about output
« Reply #10 on: March 09, 2014, 05:05:40 pm »
I'm asking how to make a real-time input output, read above ^
You were asked to clarify your question five times (3x eXpl0it3r, 2x Cardisol87), but you still repeat the same "real-time input output". Of course nobody understands what you mean.

Seriously, take the time to formulate a meaningful question if you expect to get an answer that helps you. Otherwise you're just wasting your own and our time.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

FlatlanD

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Question about output
« Reply #11 on: March 09, 2014, 06:18:07 pm »
Cadisol87 have said what i need in his post with table very clearly. What else you don't understand? I think that everything is said very clearly.

Cadisol87

  • Full Member
  • ***
  • Posts: 129
  • C++ Programmer
    • View Profile
Re: Question about output
« Reply #12 on: March 09, 2014, 07:39:45 pm »
Cadisol87 have said what i need in his post with table very clearly. What else you don't understand? I think that everything is said very clearly.

Yeah, we know what you want to do, but not what your problem is.

For real-time input you can use Events.
And output shouldn't be the problem. But if it is, read this.

FlatlanD

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Question about output
« Reply #13 on: March 09, 2014, 08:15:10 pm »
....... I know how to input and output and what use to do that, I'm just asking, do I need to make a lot of text variables, for exemple if I need to inut and output 100 times, so I need to create 100 text variables or is there a way to do that with some kind array that is drawable or something similar? Do you understand know? If not then be specific and say which part you don't get.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
AW: Re: Question about output
« Reply #14 on: March 09, 2014, 08:19:51 pm »
That was already answered:

It sounds like you're looking for some STL container, such as std::vector. Then you get one vector variable that can hold x amount of objects.
Every good C++ book will explain how to use them and you can look at a C++ reference as well. :)

To me it seems you lack quite a bit on programming/C++ knowledge. You really might want to brush that up first.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything