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

Author Topic: How to Print 2d array of Sprites(Like in a grid) in sfml?  (Read 1523 times)

0 Members and 1 Guest are viewing this topic.

hafizabdullah

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
How to Print 2d array of Sprites(Like in a grid) in sfml?
« on: January 02, 2021, 10:20:31 pm »
Hi! I am new at learning sfml. I was trying to make candy crush. I have all the png files of candies, but I don't know to print it in 2d array(grid). I tried doing that but the candy draws only one time the nested loop for 2d arra of sprite. Help will be appreciated.

LTomy

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • LTCodex
Re: How to Print 2d array of Sprites(Like in a grid) in sfml?
« Reply #1 on: January 03, 2021, 01:20:59 am »
Hi hafizabdullah,
Can you show us your code?
Do you set the position of each sprite properly?

hafizabdullah

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: How to Print 2d array of Sprites(Like in a grid) in sfml?
« Reply #2 on: January 03, 2021, 06:09:57 pm »
Well here is the link to my code. I have updated the question a little bit on stackoverflow. You see My sprites are disappearing. They aren;t staying on the screen and Idk why?

Link:
https://stackoverflow.com/questions/65551170/my-sprites-are-not-drawing-even-though-there-is-no-error