.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/07_ui/viz_card.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_07_ui_viz_card.py: ==== Card ==== This example shows how to create a card. First, some imports. .. GENERATED FROM PYTHON SOURCE LINES 11-14 .. code-block:: Python from fury import ui, window from fury.data import fetch_viz_icons .. GENERATED FROM PYTHON SOURCE LINES 15-16 First we need to fetch some icons that are included in FURY. .. GENERATED FROM PYTHON SOURCE LINES 16-19 .. code-block:: Python fetch_viz_icons() .. rst-class:: sphx-glr-script-out .. code-block:: none Data size is approximately 12KB Dataset is already in place. If you want to fetch it again please first remove the folder /Users/skoudoro/.fury/icons ({'icomoon.tar.gz': ('https://digital.lib.washington.edu/researchworks/bitstream/handle/1773/38478/icomoon.tar.gz', 'BC1FEEA6F58BA3601D6A0B029EB8DFC5F352E21F2A16BA41099A96AA3F5A4735')}, '/Users/skoudoro/.fury/icons') .. GENERATED FROM PYTHON SOURCE LINES 20-21 Let's create a card and add it to the show manager .. GENERATED FROM PYTHON SOURCE LINES 21-36 .. code-block:: Python img_url = "https://raw.githubusercontent.com/fury-gl"\ "/fury-communication-assets/main/fury-logo.png" title = "FURY" body = "FURY - Free Unified Rendering in pYthon."\ "A software library for scientific visualization in Python." card = ui.elements.Card2D(image_path=img_url, title_text=title, body_text=body, image_scale=0.55, size=(300, 300), bg_color=(1, 0.294, 0.180), bg_opacity=0.8, border_width=5, border_color=(0.1, 0.4, 0.4)) .. GENERATED FROM PYTHON SOURCE LINES 37-39 Now that the card has been initialised, we add it to the show manager. .. GENERATED FROM PYTHON SOURCE LINES 39-52 .. code-block:: Python current_size = (1000, 1000) show_manager = window.ShowManager(size=current_size, title="FURY Card Example") show_manager.scene.add(card) # To interact with the UI, set interactive = True interactive = False if interactive: show_manager.start() window.record(show_manager.scene, out_path="card_ui.png", size=(1000, 1000)) .. image-sg:: /auto_examples/07_ui/images/sphx_glr_viz_card_001.png :alt: viz card :srcset: /auto_examples/07_ui/images/sphx_glr_viz_card_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.257 seconds) .. _sphx_glr_download_auto_examples_07_ui_viz_card.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: viz_card.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: viz_card.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_