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

Author Topic: How can I make zoomable square table in SFML?  (Read 1785 times)

0 Members and 1 Guest are viewing this topic.

delio

  • Newbie
  • *
  • Posts: 49
    • View Profile
    • Email
How can I make zoomable square table in SFML?
« on: March 08, 2014, 06:21:27 pm »
I have 2 questions.

1.How can I make zoomable square table like in the picture below?





At first, there is no line of tile in squares. but when zoom in, line of tiles are slowly appear inside squares.

I'm very newbie. So, Please guide me how to get started.



2.How I can create paint bucket tool and use to fill my tile then store information into array?


Thanks, Sorry for bad English
« Last Edit: March 08, 2014, 06:34:55 pm by delio »

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: How can I make zoomable square table in SFML?
« Reply #1 on: March 08, 2014, 06:37:39 pm »
You can zoom using sf::View. The lines either appear automatically as they reach the necessary resolution, or you can colorize them explicitly depending on the current zoom level.

You should read the tutorials and documentation of SFML 2.1 to learn these concepts.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

delio

  • Newbie
  • *
  • Posts: 49
    • View Profile
    • Email
Re: How can I make zoomable square table in SFML?
« Reply #2 on: March 08, 2014, 06:45:26 pm »
You can zoom using sf::View. The lines either appear automatically as they reach the necessary resolution, or you can colorize them explicitly depending on the current zoom level.

You should read the tutorials and documentation of SFML 2.1 to learn these concepts.

Thanks. I will read it

I have another question
How can I create paint bucket tool and fill color in the tiles?
How can I split the square into tiles?

Can you guide me ? I have no idea how can I make this

« Last Edit: March 08, 2014, 06:51:51 pm by delio »

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: How can I make zoomable square table in SFML?
« Reply #3 on: March 08, 2014, 06:54:12 pm »
How can I create paint bucket tool and fill color in the tiles?
You could have a look at the flood-fill algorithm.

How can I split the square into tiles?
By using multiple tiles in its place, for example multiple sprites or shapes.

I think these things will become clearer as soon as you've experimenced a bit with SFML and maybe programming in general ;)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

delio

  • Newbie
  • *
  • Posts: 49
    • View Profile
    • Email
Re: How can I make zoomable square table in SFML?
« Reply #4 on: March 08, 2014, 06:55:28 pm »
How can I create paint bucket tool and fill color in the tiles?
You could have a look at the flood-fill algorithm.

How can I split the square into tiles?
By using multiple tiles in its place, for example multiple sprites or shapes.

I think these things will become clearer as soon as you've experimenced a bit with SFML and maybe programming in general ;)

Thanks for your kindness  :)
« Last Edit: March 08, 2014, 07:11:55 pm by delio »