Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
9f1e3903
Commit
9f1e3903
authored
Aug 26, 2017
by
Rémi Verschelde
Committed by
GitHub
Aug 26, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10648 from Xrayez/image-get-size
Add handy get_size() method to Image class
parents
9d794525
4de96518
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
image.cpp
core/image.cpp
+6
-0
image.h
core/image.h
+1
-0
No files found.
core/image.cpp
View file @
9f1e3903
...
...
@@ -343,6 +343,11 @@ int Image::get_height() const {
return
height
;
}
Vector2
Image
::
get_size
()
const
{
return
Vector2
(
width
,
height
);
}
bool
Image
::
has_mipmaps
()
const
{
return
mipmaps
;
...
...
@@ -2215,6 +2220,7 @@ void Image::_bind_methods() {
ClassDB
::
bind_method
(
D_METHOD
(
"get_width"
),
&
Image
::
get_width
);
ClassDB
::
bind_method
(
D_METHOD
(
"get_height"
),
&
Image
::
get_height
);
ClassDB
::
bind_method
(
D_METHOD
(
"get_size"
),
&
Image
::
get_size
);
ClassDB
::
bind_method
(
D_METHOD
(
"has_mipmaps"
),
&
Image
::
has_mipmaps
);
ClassDB
::
bind_method
(
D_METHOD
(
"get_format"
),
&
Image
::
get_format
);
ClassDB
::
bind_method
(
D_METHOD
(
"get_data"
),
&
Image
::
get_data
);
...
...
core/image.h
View file @
9f1e3903
...
...
@@ -177,6 +177,7 @@ private:
public
:
int
get_width
()
const
;
///< Get image width
int
get_height
()
const
;
///< Get image height
Vector2
get_size
()
const
;
bool
has_mipmaps
()
const
;
int
get_mipmap_count
()
const
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment