Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/centre point2d camers #159

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

DaGoblin
Copy link

Submitting to Splashkit on behalf of MangoS9(Bryan Taing)
Reviewed by DaGoblin (Phil Williams)

Description

Added in support for vector array and static array for center_camera_on() method for C++ as calculating multiple sprite locations can be tedious.

void center_camera_on(vector<sprite> s, double offset_x, double offset_y);

parameters:

  • vector<sprite> s
  • double offset_x
  • double offset_y
void center_camera_on(sprite s[],int size , double offset_x, double offset_y);

parameters:

  • sprite s[]
  • int size
  • double offset_x
  • double offset_y
    Both supports vector_2d data sets too:
	//static arr
	void center_camera_on(sprite s[],int size , const vector_2d &offset);
	//vector arr
	void center_camera_on(vector<sprite> s, const vector_2d &offset)

Video demo:

2023-09-07.23-12-04.mp4

Type of change

  • Overloading the method in camera.cpp and camera.h file
  • Modified the camera test to check the functionality

How Has This Been Tested?

  • Tested with Windows 10
  • Test on single variable, vector array and static array

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Requested a review from seniors on the Pull Request

move_camera_to(sc_x, sc_y);
}

void center_camera_on(sprite s[],int size, double offset_x, double offset_y) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure that we can pass sprite array parameters when this goes into the translator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants