Skip to content

Commit

Permalink
Regenerated the autocomplete information for all the graphics changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
neilccbrown committed Dec 11, 2024
1 parent 1ab57ec commit b9e9dd5
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 17 deletions.
8 changes: 5 additions & 3 deletions public/public_libraries/strype/graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,16 +461,18 @@ def __init__(self, width, height):
self.height = height

class EditableImage:
"""
An editable image of fixed width and height.
"""

# Attributes:
# __image: A Javascript OffscreenCanvas, but from the Python end it is only
# passed back to Javascript calls.

# Tracks the rate limiting for downloads:
__last_download = _time.time()

"""
An editable image of fixed width and height.
"""

def __init__(self, width, height):
"""
Creates an editable image with the given dimensions, with transparent content.
Expand Down
74 changes: 60 additions & 14 deletions src/autocompletion/skulpt-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@
},
{
"name": "verbosity",
"defaultValue": "<unittest.loader.TestLoader object at 0x105980a90>"
"defaultValue": "<unittest.loader.TestLoader object at 0x10357ea90>"
},
{
"name": "failfast",
Expand Down Expand Up @@ -1673,7 +1673,7 @@
},
{
"name": "data",
"defaultValue": "<object object at 0x1055111c0>"
"defaultValue": "<object object at 0x1030011c0>"
},
{
"name": "timeout",
Expand Down Expand Up @@ -2280,7 +2280,7 @@
},
{
"name": "deepcopy",
"defaultValue": "<function deepcopy at 0x1060d9b80>"
"defaultValue": "<function deepcopy at 0x1038a5af0>"
}
]
},
Expand Down Expand Up @@ -2322,7 +2322,7 @@
},
{
"name": "deepcopy",
"defaultValue": "<function deepcopy at 0x1060d9b80>"
"defaultValue": "<function deepcopy at 0x1038a5af0>"
}
]
},
Expand Down Expand Up @@ -2350,7 +2350,7 @@
},
{
"name": "deepcopy",
"defaultValue": "<function deepcopy at 0x1060d9b80>"
"defaultValue": "<function deepcopy at 0x1038a5af0>"
}
]
},
Expand Down Expand Up @@ -2392,7 +2392,7 @@
},
{
"name": "state",
"defaultValue": "<function deepcopy at 0x1060d9b80>"
"defaultValue": "<function deepcopy at 0x1038a5af0>"
},
{
"name": "listiter",
Expand Down Expand Up @@ -14068,7 +14068,7 @@
"strype.graphics": [
{
"acResult": "Actor",
"documentation": "",
"documentation": "\n An Actor is an item in the world with a specific image, position, rotation and scale. Everything you want to show up\n in your graphics must be an Actor. \n ",
"type": [
"function",
"type"
Expand All @@ -14086,7 +14086,7 @@
},
{
"acResult": "Dimension",
"documentation": "",
"documentation": "\n A dimension value indicating a width and a height, for example the size of an image.\n ",
"type": [
"function",
"type"
Expand All @@ -14104,7 +14104,7 @@
},
{
"acResult": "FontFamily",
"documentation": "",
"documentation": "\n A font family is a particular font type, e.g. Arial or Courier.\n ",
"type": [
"function",
"type"
Expand Down Expand Up @@ -14155,6 +14155,12 @@
],
"version": 0
},
{
"acResult": "_last_frame",
"documentation": "Convert a string or number to a floating point number, if possible.",
"type": [],
"version": 0
},
{
"acResult": "_math",
"documentation": "",
Expand All @@ -14163,6 +14169,14 @@
],
"version": 0
},
{
"acResult": "_re",
"documentation": "",
"type": [
"module"
],
"version": 0
},
{
"acResult": "_round_and_clamp_0_255",
"documentation": "",
Expand All @@ -14188,16 +14202,24 @@
"version": 0
},
{
"acResult": "get_and_forget_clicked_actor",
"documentation": "\n Gets the last clicked Actor (or None if nothing was clicked since the last call to this function). Be careful that if you call this twice\n in quick succession, the second call will almost certainly be None. If you need to compare the result of this function\n to several other things, assign it to a variable first.\n :return: The most recently clicked Actor, or None if nothing was clicked since you last called this function.\n ",
"acResult": "_time",
"documentation": "",
"type": [
"module"
],
"version": 0
},
{
"acResult": "get_clicked_actor",
"documentation": "\n Gets the last clicked Actor (or None if nothing was clicked since the last call to this function). Be careful that if you call this twice\n in quick succession, the second call will almost certainly be None. If you need to compare the result of this function\n to several other things, assign it to a variable first.\n \n :return: The most recently clicked Actor, or None if nothing was clicked since you last called this function.\n ",
"type": [
"function"
],
"version": 0
},
{
"acResult": "in_bounds",
"documentation": "\n Checks if the given X, Y position is in the visible bounds of (-400,-300) inclusive to (400, 300) exclusive \n :param x: \n :param y: \n :return: A boolean indicating whether it is in the visible bounds\n ",
"documentation": "\n Checks if the given X, Y position is in the visible bounds of (-399,-299) inclusive to (400, 300) exclusive.\n \n :param x: The x position to check\n :param y: The y position to check\n :return: A boolean indicating whether it is in the visible bounds: True if it is in bounds, False if it is not.\n ",
"type": [
"function"
],
Expand All @@ -14213,7 +14235,31 @@
},
{
"acResult": "load_image",
"documentation": "\n Loads the given image file as an EditableImage object.\n :param filename: The built-in Strype filename, or URL, of the image to load.\n :return: An EditableImage object with the same image and dimensions as the given file\n ",
"documentation": "\n Loads the given image file as an EditableImage object.\n \n Note: you can pass a filename for the image, which is an image name from Strype's image library,\n or a URL to an image. Using a URL requires the server to allow remote image loading from Javascript via a feature\n called CORS. Many servers do not allow this, so you may get an error even if the URL is valid and\n you can load the image in a browser yourself.\n \n :param filename: The built-in Strype filename, or URL, of the image to load.\n :return: An EditableImage object with the same image and dimensions as the given file\n ",
"type": [
"function"
],
"version": 0
},
{
"acResult": "pause",
"documentation": "\n Waits for a suitable amount of time since the last call to pause() to allow you to take\n the given number of actions per second. This is almost always used like follows:\n \n ```\n while True:\n # Do all the actions you want to do in one go\n pause(30)\n ```\n \n Where 30 is the number of times you want to do those actions per second. It is like sleeping\n for 1/30th of a second, but it accounts for the fact that your actions may have taken some time,\n so it aims to keep you executing the actions 30 times per second (or whatever value you pass\n for actions_per_second).\n ",
"type": [
"function"
],
"version": 0
},
{
"acResult": "set_background",
"documentation": "\n Sets the current background image.\n \n The parameter can be an EditableImage, a colour, a filename of an image in Strype's image library, or a URL.\n Using a URL requires the server to allow remote image loading from Javascript via a feature\n called CORS. Many servers do not allow this, so you may get an error even if the URL is valid and\n you can load the image in a browser yourself.\n \n If the background image is smaller than 800x600, it will be tiled (repeated) to fill the area of 800x600.\n The background image is always copied, so later changes to an EditableImage will not be shown in the background;\n you should call set_background() again to update it.\n \n :param image_or_filename: An EditableImage, an image filename or URL.\n ",
"type": [
"function"
],
"version": 0
},
{
"acResult": "stop",
"documentation": "\n Stops the whole execution immediately. Will not return.\n ",
"type": [
"function"
],
Expand Down Expand Up @@ -14276,7 +14322,7 @@
},
{
"acResult": "play_sound",
"documentation": "\n Starts playing the given sound, returning immediately without waiting for it to finish.\n :param filename: The filename of the sound \n ",
"documentation": "\n Starts playing the given sound, returning immediately without waiting for it to finish.\n \n :param filename: The filename of the sound \n ",
"type": [
"function"
],
Expand Down

0 comments on commit b9e9dd5

Please sign in to comment.